-
Notifications
You must be signed in to change notification settings - Fork 149
ci: migrate to GitHub Actions #286
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
Changes from all commits
d3b7ded
44a4b41
4667c22
b25fdbd
2b7c944
9c8f687
3692bd0
bbb5bd6
b846a92
4012c24
b4fb982
d4a1af0
b69893f
199ae48
6fcc3d4
1461bf2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version: 2 | ||
updates: | ||
# Set update schedule for GitHub Actions | ||
- package-ecosystem: 'github-actions' | ||
directory: '/' | ||
schedule: | ||
interval: 'daily' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
# semantic-release valid branches | ||
- '+([0-9])?(.{+([0-9]),x}).x' | ||
- 'main' | ||
- 'next' | ||
- 'next-major' | ||
- 'beta' | ||
- 'alpha' | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
jobs: | ||
code_validation: | ||
name: Code Validation | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
|
||
- name: Use Node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
|
||
- name: Install dependencies | ||
uses: bahmutov/npm-install@v1 | ||
with: | ||
useLockFile: false | ||
|
||
- name: Lint code | ||
run: npm run lint | ||
|
||
# TODO: reenable on v4 | ||
# - name: Check format | ||
# run: npm run format:check | ||
|
||
test: | ||
name: Tests (Node v${{ matrix.node }} - ESLint v${{ matrix.eslint }}) | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node: ['10.12', '10', '12.0', '12', '14'] | ||
eslint: [5, 6, 7] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
|
||
- name: Use Node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
|
||
- name: Install dependencies | ||
uses: bahmutov/npm-install@v1 | ||
with: | ||
useLockFile: false | ||
|
||
- name: Install ESLint v${{ matrix.eslint }} | ||
run: npm install --no-save eslint@${{ matrix.eslint }} | ||
|
||
- name: Run tests | ||
run: npm run test:ci |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_run: | ||
workflows: ['CI'] | ||
types: | ||
- completed | ||
push: | ||
branches: | ||
# semantic-release valid branches | ||
- '+([0-9])?(.{+([0-9]),x}).x' | ||
- 'main' | ||
- 'next' | ||
- 'next-major' | ||
- 'beta' | ||
- 'alpha' | ||
|
||
jobs: | ||
main: | ||
name: NPM Release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
|
||
- name: Use Node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
|
||
- name: Install dependencies | ||
uses: bahmutov/npm-install@v1 | ||
with: | ||
useLockFile: false | ||
|
||
- name: Build package | ||
run: npm run build | ||
Comment on lines
+37
to
+38
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we build in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mmmm not really sure about that, what would be the purpose for it? I'm gonna merge both workflows into a single file actually, since it's triggering the release twice. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to ensure there are no compilation errors (Typings for instance) committed without noticing? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah! I'm doing that on v4 so on "Code Validation" job I'll add format check and typescript check steps. I'll create a PR later with those updates for v4! |
||
|
||
- name: Release new version to NPM | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: npx semantic-release |
This file was deleted.
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.
I think it is not necessary to use an extra GH action here, while a simple
should do the trick
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.
This npm-install action will cache stuff related to npm properly :)
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.
ohh nice