|
1 | | -name: Build CI |
2 | | -on: [push] |
| 1 | +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node |
| 2 | +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions |
| 3 | + |
| 4 | +name: Node.js CI |
| 5 | + |
| 6 | +on: [push, pull_request] |
| 7 | + |
3 | 8 | jobs: |
4 | 9 | tests: |
5 | 10 | runs-on: ubuntu-latest |
6 | 11 | strategy: |
7 | 12 | matrix: |
8 | | - node-version: [10.x, 12.x, 13.x] |
| 13 | + node-version: [10, 12, 14, 16] |
| 14 | + fail-fast: false |
9 | 15 | steps: |
10 | | - - uses: actions/checkout@v1 |
11 | | - - name: Use Node.js ${{ matrix.node-version }} |
12 | | - uses: actions/setup-node@v1 |
13 | | - with: |
14 | | - node-version: ${{ matrix.node-version }} |
15 | | - - name: Install node_modules |
16 | | - run: yarn install |
17 | | - - name: Test |
18 | | - run: yarn test |
19 | | - env: |
20 | | - CI: true |
21 | | - - name: Build |
22 | | - run: yarn build |
23 | | - - name: Send coverage (only Node 12.x) |
24 | | - if: startsWith(matrix.node-version, '12.') |
25 | | - run: bash <(curl -s https://codecov.io/bash) |
26 | | - env: |
27 | | - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
28 | | - |
29 | | - |
| 16 | + - uses: actions/checkout@v2 |
| 17 | + - name: Use Node.js ${{ matrix.node-version }} |
| 18 | + uses: actions/setup-node@v2 |
| 19 | + with: |
| 20 | + node-version: ${{ matrix.node-version }} |
| 21 | + - name: Install node_modules |
| 22 | + run: yarn |
| 23 | + - name: Test – Jest |
| 24 | + run: yarn coverage |
| 25 | + env: |
| 26 | + CI: true |
| 27 | + - name: Test – Eslint |
| 28 | + if: ${{ always() && matrix.node-version == '12' }} |
| 29 | + run: yarn eslint |
| 30 | + - name: Test – TSCheck |
| 31 | + if: ${{ always() && matrix.node-version == '12' }} |
| 32 | + run: yarn tscheck |
| 33 | + - name: Publish Test Report |
| 34 | + if: ${{ always() && matrix.node-version == '12' }} |
| 35 | + uses: mikepenz/action-junit-report@v2 |
| 36 | + with: |
| 37 | + check_name: JUnit Annotations for Node ${{ matrix.node-version }} |
| 38 | + report_paths: '**/coverage/junit/**/*.xml' |
| 39 | + - name: Testing with previous graphql versions |
| 40 | + run: yarn test-prev-vers |
| 41 | + env: |
| 42 | + CI: true |
| 43 | + - name: Send codecov.io stats |
| 44 | + if: matrix.node-version == '12' |
| 45 | + run: bash <(curl -s https://codecov.io/bash) || echo '' |
| 46 | + |
30 | 47 | publish: |
31 | | - if: github.ref == 'refs/heads/master' |
| 48 | + if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/alpha' || github.ref == 'refs/heads/beta' |
32 | 49 | needs: [tests] |
33 | 50 | runs-on: ubuntu-latest |
34 | 51 | steps: |
35 | | - - uses: actions/checkout@v1 |
36 | | - - name: Use Node.js 12 |
37 | | - uses: actions/setup-node@v1 |
38 | | - with: |
39 | | - node-version: 12.x |
40 | | - - name: Install node_modules |
41 | | - run: yarn install |
42 | | - - name: Build |
43 | | - run: yarn build |
44 | | - - name: Semantic Release (publish to npm) |
45 | | - run: yarn semantic-release |
46 | | - env: |
47 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
48 | | - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 52 | + - uses: actions/checkout@v2 |
| 53 | + - name: Use Node.js 12 |
| 54 | + uses: actions/setup-node@v2 |
| 55 | + with: |
| 56 | + node-version: 12 |
| 57 | + - name: Install node_modules |
| 58 | + run: yarn install |
| 59 | + - name: Build |
| 60 | + run: yarn build |
| 61 | + - name: Semantic Release (publish to npm) |
| 62 | + run: yarn semantic-release |
| 63 | + env: |
| 64 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 65 | + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 66 | + |
0 commit comments