-
Notifications
You must be signed in to change notification settings - Fork 3
62 lines (61 loc) · 2.05 KB
/
onPR.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: onPR
on:
pull_request:
branches: '**'
jobs:
build:
name: Building and Testing
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 16.19.0 ]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm install
- uses: chromaui/action@v1
id: chromatic
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
autoAcceptChanges: main
- if: steps.chromatic.outputs.buildUrl != 'undefined'
name: Publish Summary
run: |
echo "${{steps.chromatic.outputs.buildUrl}}" >> $GITHUB_STEP_SUMMARY
- if: steps.chromatic.outputs.buildUrl != 'undefined'
name: Find chromatic comment
uses: peter-evans/find-comment@v2
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Chromatic build output
- if: steps.chromatic.outputs.buildUrl != 'undefined'
name: Create chromatic comment
uses: peter-evans/create-or-update-comment@v2
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
## Chromatic build output
| Name | Link |
| --- | --- |
| Build Results | ${{steps.chromatic.outputs.buildUrl}} |
| Storybook Preview | ${{steps.chromatic.outputs.storybookUrl}} |
| Component Count | ${{steps.chromatic.outputs.componentCount}} |
edit-mode: replace
- run: npm run build
- run: npm run test
- run: npm run make-badges:ci
- run: npm run coverage:codecov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
flags: coverage