|
9 | 9 | name: Build |
10 | 10 |
|
11 | 11 | jobs: |
| 12 | + eslint: |
| 13 | + name: ESLint |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v1 |
| 17 | + with: |
| 18 | + fetch-depth: 3 |
| 19 | + - name: Install Package dependencies |
| 20 | + run: yarn install |
| 21 | + - name: Check code style |
| 22 | + run: yarn lint |
| 23 | + - uses: 8398a7/action-slack@v1 |
| 24 | + with: |
| 25 | + type: failure |
| 26 | + env: |
| 27 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 28 | + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |
| 29 | + if: failure() |
| 30 | + |
12 | 31 | jest: |
13 | 32 | name: Jest |
14 | 33 | runs-on: ubuntu-latest |
| 34 | + strategy: |
| 35 | + matrix: |
| 36 | + node: ['8', '10', '11', '12'] |
15 | 37 | steps: |
16 | 38 | - uses: actions/checkout@v1 |
17 | 39 | with: |
18 | | - fetch-depth: 1 |
| 40 | + fetch-depth: 3 |
| 41 | + - name: Setup node |
| 42 | + uses: actions/setup-node@v1 |
| 43 | + with: |
| 44 | + node-version: ${{ matrix.node }} |
19 | 45 | - name: Install Package dependencies |
20 | 46 | run: yarn install |
21 | 47 | - name: Run tests |
22 | 48 | run: yarn cover |
23 | | - - name: Send covarage |
24 | | - run: yarn add coveralls && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js |
25 | | - env: |
26 | | - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} |
27 | | - COVERALLS_SERVICE_NAME: "GitHub Action" |
28 | | - COVERALLS_SERVICE_JOB_ID: ${{ github.sha }} |
29 | | - COVERALLS_GIT_COMMIT: ${{ github.sha }} |
30 | | - COVERALLS_GIT_BRANCH: ${{ github.ref }} |
| 49 | + - name: Coveralls |
| 50 | + uses: coverallsapp/github-action@master |
| 51 | + with: |
| 52 | + github-token: ${{ secrets.github_token }} |
| 53 | + parallel: true |
31 | 54 | - uses: 8398a7/action-slack@v1 |
32 | 55 | with: |
33 | 56 | type: failure |
34 | 57 | env: |
35 | 58 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
36 | 59 | SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |
37 | 60 | if: failure() |
| 61 | + |
| 62 | + coverallsFinished: |
| 63 | + name: Coveralls Finished |
| 64 | + needs: jest |
| 65 | + runs-on: ubuntu-latest |
| 66 | + steps: |
| 67 | + - name: Coveralls Finished |
| 68 | + uses: coverallsapp/github-action@master |
| 69 | + with: |
| 70 | + github-token: ${{ secrets.github_token }} |
| 71 | + parallel-finished: true |
| 72 | + |
| 73 | + slack: |
| 74 | + name: Slack |
| 75 | + needs: coverallsFinished |
| 76 | + runs-on: ubuntu-latest |
| 77 | + steps: |
38 | 78 | - uses: 8398a7/action-slack@v1 |
39 | 79 | with: |
40 | 80 | type: success |
41 | 81 | env: |
42 | 82 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
43 | 83 | SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |
44 | | - if: success() |
|
0 commit comments