-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
chore: migrate build from azure-pipelines to actions #1383
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
Merged
JamesHenry
merged 16 commits into
typescript-eslint:master
from
armano2:github-actions-test
Mar 16, 2020
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
20d7bc8
chore: migrate build from azure-pipelines to actions
armano2 42f88f2
chore: filter out branches
armano2 4cadfcb
Create ci.yml
armano2 fe9df4e
fix: correct typo in name of folder
armano2 e791217
fix: correct typo
armano2 d05a1ac
test: add changes requested in code review
armano2 e45fb61
fix: do not run build on push on other branches than master
armano2 025c2c1
fix: correct syntax
armano2 4efeba4
fix: let pull_requests to be run on all branches
armano2 5cf09e9
chore: update ci to match azure
armano2 a2f8435
chore: upgrade actions/checkout and add yarn cache
armano2 bb20596
chore: add missing CI env variable for unit tests
armano2 d5f807f
test: disable cache and enable `--runInBand`
armano2 204aae6
test: apply new changes to CI config
armano2 b89e4d1
chore: update shields
armano2 11d7c7b
Merge branch 'master' into github-actions-test
JamesHenry 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 contains hidden or 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,106 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
primary_code_validation_and_tests: | ||
name: Primary code validation and tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js 12 | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12 | ||
|
||
# This also runs a build as part of the postinstall bootstrap | ||
- name: install and build | ||
run: | | ||
yarn --ignore-engines --frozen-lockfile | ||
yarn check-clean-workspace-after-install | ||
|
||
# Note that this command *also* typechecks tests/tools, | ||
# whereas the build only checks src files | ||
- name: Typecheck all packages | ||
run: yarn typecheck | ||
|
||
- name: Check code formatting | ||
run: yarn format-check | ||
|
||
- name: Run linting | ||
run: yarn lint | ||
|
||
- name: Validate spelling | ||
run: yarn check:spelling | ||
|
||
- name: Run unit tests | ||
run: yarn test | ||
env: | ||
CI: true | ||
|
||
- name: Run integrations tests | ||
run: yarn integration-tests | ||
env: | ||
CI: true | ||
|
||
- name: Publish code coverage report | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
yml: ./codecov.yml | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
flags: unittest | ||
name: codecov | ||
|
||
unit_tests_on_other_node_versions: | ||
name: Run unit tests on other Node.js versions | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [8.x, 10.x] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
# This also runs a build as part of the postinstall bootstrap | ||
- name: install and build | ||
run: | | ||
yarn --ignore-engines --frozen-lockfile | ||
yarn check-clean-workspace-after-install | ||
|
||
- name: Run unit tests | ||
run: yarn test | ||
env: | ||
CI: true | ||
|
||
publish_canary_version: | ||
name: Publish the latest code as a canary version | ||
runs-on: ubuntu-latest | ||
needs: [primary_code_validation_and_tests, unit_tests_on_other_node_versions] | ||
if: github.event_name == 'push' && github.ref == 'refs/head/master' | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Use Node.js 12 | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12 | ||
registry-url: https://registry.npmjs.org/ | ||
|
||
# This also runs a build as part of the postinstall bootstrap | ||
- name: install and build | ||
run: | | ||
yarn --ignore-engines --frozen-lockfile | ||
yarn check-clean-workspace-after-install | ||
|
||
# - name: Publish all packages to npm | ||
# run: npx lerna publish --canary --exact --force-publish --yes | ||
# env: | ||
# NODE_AUTH_TOKEN: ${{ secrets.npm_token }} |
This file contains hidden or 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
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.
Question - did we want to split all of this up to give us more granular status checks?
I know that a bit of a pain point for people is just seeing "primary validation" failed, and then having to dig into the logs to see which step failed.
I.e. one job for each of:
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.
you actually don't have to as actions are showing it in overview screen
example: https://github.com/armano2/test-eslint-monorpo/actions/runs/36409848
you can click on
Check failure on line 1 in packages/a/src/index.js
if file was modified it's going to show annotation within this file