|
1 | 1 | jobs: |
2 | | - cancel-existing: |
| 2 | + build: |
3 | 3 | if: "!contains(github.event.head_commit.message, '[skip ci]')" |
4 | 4 | runs-on: ubuntu-latest |
5 | 5 | steps: |
6 | 6 | - env: |
7 | 7 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
8 | 8 | |
9 | | - release: |
10 | | - needs: test |
11 | | - runs-on: ubuntu-latest |
12 | | - steps: |
13 | 9 | - uses: actions/checkout@v2 |
14 | 10 | with: |
| 11 | + fetch-depth: 0 |
15 | 12 | lfs: true |
| 13 | + ref: ${{ github.event.pull_request.head.repo.full_name == github.repository && |
| 14 | + github.event.pull_request.head.ref || '' }} |
16 | 15 | - uses: actions/setup-node@v2 |
17 | 16 | with: |
18 | 17 | node-version: 12 |
19 | 18 | - run: git config --global user.email "[email protected]" |
20 | 19 | - run: git config --global user.name "GitHub Actions" |
21 | 20 | - run: yarn --frozen-lockfile |
22 | | - - run: yarn lint |
| 21 | + - run: yarn test |
| 22 | + - if: failure() |
| 23 | + uses: actions/upload-artifact@v2 |
| 24 | + with: |
| 25 | + path: "**/__image_snapshots__/__diff_output__" |
| 26 | + - uses: codecov/codecov-action@v1 |
| 27 | + with: |
| 28 | + fail_ci_if_error: true |
| 29 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 30 | + - run: yarn checkUnknownFiles |
23 | 31 | - env: |
24 | 32 | GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }} |
25 | 33 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
|
31 | 39 | if: github.ref == 'refs/heads/master' |
32 | 40 | name: Release |
33 | 41 | run: yarn semantic-release |
34 | | - test: |
35 | | - needs: cancel-existing |
36 | | - runs-on: ${{ matrix.os }} |
37 | | - steps: |
38 | | - - uses: actions/checkout@v2 |
39 | | - with: |
40 | | - fetch-depth: 0 |
41 | | - lfs: true |
42 | | - - uses: actions/setup-node@v2 |
43 | | - with: |
44 | | - node-version: ${{ matrix.node }} |
45 | | - - run: yarn --frozen-lockfile |
46 | | - - run: yarn test |
47 | | - - if: failure() |
48 | | - uses: actions/upload-artifact@v2 |
49 | | - with: |
50 | | - path: "**/__image_snapshots__/__diff_output__" |
51 | | - - run: yarn checkUnknownFiles |
52 | | - - if: matrix.os == 'ubuntu-latest' && matrix.node == 12 |
53 | | - uses: codecov/codecov-action@v1 |
54 | | - with: |
55 | | - fail_ci_if_error: true |
56 | | - token: ${{ secrets.CODECOV_TOKEN }} |
57 | | - strategy: |
58 | | - matrix: |
59 | | - node: |
60 | | - - 10 |
61 | | - - 12 |
62 | | - os: |
63 | | - - ubuntu-latest |
64 | 42 | name: build |
65 | 43 | on: |
| 44 | + pull_request: {} |
66 | 45 | push: |
67 | 46 | branches: |
68 | | - - "**" |
| 47 | + - master |
0 commit comments