|
| 1 | +name: CI |
| 2 | +on: [push, pull_request] |
| 3 | +jobs: |
| 4 | + |
| 5 | + lint: |
| 6 | + runs-on: ubuntu-latest |
| 7 | + steps: |
| 8 | + - uses: actions/checkout@v2 |
| 9 | + - uses: actions/cache@v2 |
| 10 | + with: |
| 11 | + path: '**/node_modules' |
| 12 | + key: ${{ runner.os }}-lint-modules-${{ hashFiles('**/yarn.lock') }} |
| 13 | + - uses: actions/setup-node@v2 |
| 14 | + with: |
| 15 | + node-version: 14.x |
| 16 | + - run: yarn install |
| 17 | + - run: yarn run lint |
| 18 | + |
| 19 | + test: |
| 20 | + runs-on: ${{ matrix.os }} |
| 21 | + strategy: |
| 22 | + matrix: |
| 23 | + os: [ubuntu-latest] |
| 24 | + node-version: |
| 25 | + - 12.x |
| 26 | + - 14.x |
| 27 | + - 16.x |
| 28 | + steps: |
| 29 | + - name: Use Node.js ${{ matrix.node-version }} |
| 30 | + uses: actions/setup-node@v2 |
| 31 | + with: |
| 32 | + node-version: ${{ matrix.node-version }} |
| 33 | + - name: Ensure line endings are consistent |
| 34 | + run: git config --global core.autocrlf input |
| 35 | + - name: Check out repository |
| 36 | + uses: actions/checkout@v2 |
| 37 | + - uses: actions/cache@v2 |
| 38 | + with: |
| 39 | + path: '**/node_modules' |
| 40 | + key: ${{ runner.os }}-test-modules-${{ hashFiles('**/yarn.lock') }} |
| 41 | + - name: Install dependencies |
| 42 | + run: yarn install |
| 43 | + - name: Build project |
| 44 | + run: yarn run build |
| 45 | + - name: Run tests |
| 46 | + run: yarn run test |
| 47 | + - name: Submit coverage results |
| 48 | + uses: coverallsapp/github-action@master |
| 49 | + with: |
| 50 | + github-token: ${{ secrets.github_token }} |
| 51 | + flag-name: run-${{ matrix.node-version }} |
| 52 | + parallel: true |
| 53 | + |
| 54 | + coveralls: |
| 55 | + needs: test |
| 56 | + runs-on: ubuntu-latest |
| 57 | + steps: |
| 58 | + - name: Consolidate test coverage from different jobs |
| 59 | + uses: coverallsapp/github-action@master |
| 60 | + with: |
| 61 | + github-token: ${{ secrets.github_token }} |
| 62 | + parallel-finished: true |
0 commit comments