Skip to content

Commit

Permalink
ci: migrate to github actions (#154)
Browse files Browse the repository at this point in the history
* ci: deprecate circleci

* ci: add github actions for new pipeline

* ci: lift safety catch
  • Loading branch information
superical authored Jan 16, 2023
1 parent 7493fdd commit 4ed7559
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 54 deletions.
54 changes: 0 additions & 54 deletions .circleci/config.yml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
on:
pull_request:
workflow_call:

env:
NODE_ENV: ci

name: "Linters"

jobs:
lint:
name: Code Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14.x
- run: npm ci --ignore-scripts
- run: npm run lint

eslint-review:
name: ES Lint Review
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v3
- uses: reviewdog/action-eslint@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

commit-lint:
name: Commit Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Commit Lint Dependencies
run: npm install @commitlint/config-conventional
- uses: JulienKode/[email protected]
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
on:
push:
branches:
- master
- beta
- +([0-9])?(.{+([0-9]),x}).x

env:
NODE_ENV: ci

name: Release

jobs:
tests:
uses: ./.github/workflows/tests.yml
linters:
uses: ./.github/workflows/linters.yml
release:
name: Publish Release
runs-on: ubuntu-latest
needs: [tests, linters]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14.x
- run: npm ci
- run: npm run build
- uses: codfish/semantic-release-action@v2
id: semantic
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Output new release version
if: steps.semantic.outputs.new-release-published == 'true'
run: |
echo "🎉New Release Published: ${{ steps.semantic.outputs.release-version }}"
51 changes: 51 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
on:
pull_request:
types: [ opened, reopened, synchronize ]
workflow_call:

env:
NODE_ENV: ci

name: "Tests"

jobs:
run-tests:
name: Run Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14.x
- run: npm ci --ignore-scripts
- run: npm run coverage
- uses: actions/upload-artifact@v3
with:
name: test-coverage
path: ./coverage/lcov.info

test-build:
name: Test Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14.x
- run: npm ci --ignore-scripts
- run: npm run build

coverage:
name: Test Coverage
needs: [ run-tests ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download coverage
uses: actions/download-artifact@v3
with:
name: test-coverage
- uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
verbose: true

0 comments on commit 4ed7559

Please sign in to comment.