forked from sunstar-engineering/sunstar-engineering
-
Notifications
You must be signed in to change notification settings - Fork 4
53 lines (45 loc) · 1.41 KB
/
visual-tests.yaml
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
name: Visual Tests
on:
pull_request:
types: [ opened, synchronize ]
env:
TEST_PATHS: "/ /career/yuya-yoshisue"
TEST_PATHS_INDEXES: "/sidekick/library.json "
DOMAIN_MAIN: "main--sunstar--hlxsites.hlx.page"
DOMAIN_BRANCH: "${{github.head_ref}}--sunstar--hlxsites.hlx.page"
jobs:
compare-pages:
runs-on: ubuntu-latest
defaults:
run:
working-directory: .github/visual-tests
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: npm ci
- name: Generate path list
run: |
npm run collect-urls
cat generated-test-paths.txt
- name: Install Playwright Browsers
run: npx playwright install --with-deps chromium
- name: Run Playwright tests
id: run-playwright-tests
run: ./run-and-create-github-summary.bash
- uses: actions/upload-artifact@v3
if: always()
with:
path: .github/visual-tests/screenshots/*
name: screenshots
- name: Comment on Pull Request
if: env.SUMMARY != ''
uses: peter-evans/create-or-update-comment@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.number }}
body: ${{ env.SUMMARY }}
# edit-mode: replace
# comment-id: ${{ steps.find-comment.outputs.comment-id }}