-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (49 loc) · 1.89 KB
/
check_pr.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
name: Check PR
on:
pull_request:
env:
CI: true
TURBO_API: http://127.0.0.1:9080
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: foo
jobs:
visual-regression-test:
name: Run visual regression test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: marshallku/actions/setup/pnpm@master
- name: TurboRepo server
uses: felixmosh/turborepo-gh-artifacts@v3
with:
repo-token: ${{ github.token }}
- name: Install puppeteer
run: npx puppeteer browsers install chrome
- name: Run backstop server in background
run: pnpm dev --filter @marshallku/visual-regression &
- name: Build apps and packages without blog
run: pnpm build --filter !@marshallku/blog
- name: Run test
id: test
continue-on-error: true
run: pnpm test:visual-regression
- name: Check test result
id: check-test-result
run: |
OUTPUT=$(node apps/visual-regression/reportResult.js)
echo "$OUTPUT" >> "$GITHUB_ENV"
- name: Comment test result
if: ${{ !cancelled() }}
uses: thollander/actions-comment-pull-request@v2
with:
message: |
Test result - ${{ steps.test.outcome }}
${{ env.TEST_RESULT }}
You can check results [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
- name: Upload test results
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: backstop-data
path: apps/visual-regression/backstop_data
retention-days: 30