-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add start of github actions (#1383)
- Loading branch information
Showing
2 changed files
with
108 additions
and
2 deletions.
There are no files selected for viewing
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,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 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