Skip to content

Commit

Permalink
ci: migrate to github actions (#252)
Browse files Browse the repository at this point in the history
* chore: upgrade to node 18

* fix: commitlint install issue and introduce typing

* test: upgrade jest and update snapshots

* ci: migrate to github actions

* ci: npm run test

* chore: revert commitlint config typing
  • Loading branch information
HJunyuan authored Aug 3, 2023
1 parent 8e18314 commit 2e705f8
Show file tree
Hide file tree
Showing 15 changed files with 12,479 additions and 10,236 deletions.
35 changes: 0 additions & 35 deletions .circleci/config.yml

This file was deleted.

12 changes: 12 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Summary

What is the background of this pull request?

## Changes

- What are the changes made in this pull request?
- Change this and that, etc...

## Issues

What are the related issues or stories?
28 changes: 28 additions & 0 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
on:
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: 18.x
- run: npm ci --ignore-scripts
- run: npm run lint

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]
29 changes: 29 additions & 0 deletions .github/workflows/pull_requests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on:
pull_request:
types: [opened, reopened, synchronize]

env:
NODE_ENV: ci

name: "Pull Requests"

jobs:
tests:
name: Tests
uses: ./.github/workflows/tests.yml

linters:
name: Linters
uses: ./.github/workflows/linters.yml

eslint-review:
name: ESLint 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 }}
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
on:
push:
branches:
- master
- beta
- +([0-9])?(.{+([0-9]),x}).x

env:
NODE_ENV: ci

name: Release

jobs:
tests:
name: Tests
uses: ./.github/workflows/tests.yml

linters:
name: 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: 18.x
- run: npm ci && npm run postinstall
- 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 }}"
30 changes: 30 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
on:
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: 18.x
- run: npm ci && npm run postinstall
- run: npm run test

test-build:
name: Test Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18.x
- run: npm ci && npm run postinstall
- run: npm run build
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
lts/hydrogen
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: "ts-jest",
setupFiles: ["core-js"],
testEnvironment: "node",
testPathIgnorePatterns: ["node_modules", "dist"],
watchPathIgnorePatterns: ["/node_modules/", "dist"],
Expand Down
Loading

0 comments on commit 2e705f8

Please sign in to comment.