-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: migrate to github actions #92
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6154e69
ci: migrate to github actions
HJunyuan 88ef773
ci: use commitlint directly
HJunyuan d4a7f7b
ci: npm run build
HJunyuan 974d802
ci: install dependencies before using commitlint
HJunyuan 9a3405c
ci: fix commitlint command
HJunyuan 7ac8530
chore: upgrade commitlint
HJunyuan 886b339
ci: target from base sha
HJunyuan a637410
ci: commitlint fetch-depth=0
HJunyuan 57c6b79
ci: remove commitlint --last
HJunyuan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
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 | ||
if: github.event_name == 'pull_request' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
- run: npm ci --ignore-scripts | ||
- name: Validate PR commits with commitlint | ||
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- +([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 | ||
- name: Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: npx semantic-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
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 build | ||
- 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 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we squash most of our PRs, should we commit lint the title of the PR instead of the individual commits, which will be squashed anyway? The title of the PR will be the committed name that will eventually be on the actual history.😅
I think we can keep what you have. If we want to lint the PR title, we can make use of
github.event.pull_request.title
and pass it to commitlint.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops... I just realise this PR has been merged. It's ok, just a small thing. haha