|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - '**' |
| 10 | + |
| 11 | +jobs: |
| 12 | + primary_code_validation_and_tests: |
| 13 | + name: Primary code validation and tests |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v2 |
| 17 | + - name: Use Node.js 12 |
| 18 | + uses: actions/setup-node@v1 |
| 19 | + with: |
| 20 | + node-version: 12 |
| 21 | + |
| 22 | + # This also runs a build as part of the postinstall bootstrap |
| 23 | + - name: install and build |
| 24 | + run: | |
| 25 | + yarn --ignore-engines --frozen-lockfile |
| 26 | + yarn check-clean-workspace-after-install |
| 27 | +
|
| 28 | + # Note that this command *also* typechecks tests/tools, |
| 29 | + # whereas the build only checks src files |
| 30 | + - name: Typecheck all packages |
| 31 | + run: yarn typecheck |
| 32 | + |
| 33 | + - name: Check code formatting |
| 34 | + run: yarn format-check |
| 35 | + |
| 36 | + - name: Run linting |
| 37 | + run: yarn lint |
| 38 | + |
| 39 | + - name: Validate spelling |
| 40 | + run: yarn check:spelling |
| 41 | + |
| 42 | + - name: Run unit tests |
| 43 | + run: yarn test |
| 44 | + env: |
| 45 | + CI: true |
| 46 | + |
| 47 | + - name: Run integrations tests |
| 48 | + run: yarn integration-tests |
| 49 | + env: |
| 50 | + CI: true |
| 51 | + |
| 52 | + - name: Publish code coverage report |
| 53 | + uses: codecov/codecov-action@v1 |
| 54 | + with: |
| 55 | + yml: ./codecov.yml |
| 56 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 57 | + flags: unittest |
| 58 | + name: codecov |
| 59 | + |
| 60 | + unit_tests_on_other_node_versions: |
| 61 | + name: Run unit tests on other Node.js versions |
| 62 | + runs-on: ubuntu-latest |
| 63 | + strategy: |
| 64 | + matrix: |
| 65 | + node-version: [8.x, 10.x] |
| 66 | + steps: |
| 67 | + - uses: actions/checkout@v2 |
| 68 | + - name: Use Node.js ${{ matrix.node-version }} |
| 69 | + uses: actions/setup-node@v1 |
| 70 | + with: |
| 71 | + node-version: ${{ matrix.node-version }} |
| 72 | + |
| 73 | + # This also runs a build as part of the postinstall bootstrap |
| 74 | + - name: install and build |
| 75 | + run: | |
| 76 | + yarn --ignore-engines --frozen-lockfile |
| 77 | + yarn check-clean-workspace-after-install |
| 78 | +
|
| 79 | + - name: Run unit tests |
| 80 | + run: yarn test |
| 81 | + env: |
| 82 | + CI: true |
| 83 | + |
| 84 | + publish_canary_version: |
| 85 | + name: Publish the latest code as a canary version |
| 86 | + runs-on: ubuntu-latest |
| 87 | + needs: [primary_code_validation_and_tests, unit_tests_on_other_node_versions] |
| 88 | + if: github.event_name == 'push' && github.ref == 'refs/head/master' |
| 89 | + steps: |
| 90 | + - uses: actions/checkout@v1 |
| 91 | + - name: Use Node.js 12 |
| 92 | + uses: actions/setup-node@v1 |
| 93 | + with: |
| 94 | + node-version: 12 |
| 95 | + registry-url: https://registry.npmjs.org/ |
| 96 | + |
| 97 | + # This also runs a build as part of the postinstall bootstrap |
| 98 | + - name: install and build |
| 99 | + run: | |
| 100 | + yarn --ignore-engines --frozen-lockfile |
| 101 | + yarn check-clean-workspace-after-install |
| 102 | +
|
| 103 | +# - name: Publish all packages to npm |
| 104 | +# run: npx lerna publish --canary --exact --force-publish --yes |
| 105 | +# env: |
| 106 | +# NODE_AUTH_TOKEN: ${{ secrets.npm_token }} |
0 commit comments