-
Notifications
You must be signed in to change notification settings - Fork 58
106 lines (91 loc) · 3.23 KB
/
snapshotCompare.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Compare Snapshots
on:
# allow for manual triggers
workflow_dispatch: {}
workflow_call: {}
push:
branches:
- develop
pull_request: {}
jobs:
getMatrix:
name: Get Matrix
runs-on: ubuntu-latest
outputs:
testPathPatterns: ${{ steps.setTestPathPatterns.outputs.testPathPatterns }}
testConfigs: ${{ steps.setTestConfigs.outputs.testConfigs }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
persist-credentials: false
- id: setTestPathPatterns
name: Set test path patterns
run: |
echo "testPathPatterns=$(./.github/scripts/getTestPathPatterns.sh)" >> $GITHUB_OUTPUT
- id: setTestConfigs
name: Set test config environment variables
run: |
echo "testConfigs=$(./.github/scripts/getTestConfigs.sh)" >> $GITHUB_OUTPUT
compareSnapshots:
name: Compare
runs-on: ubuntu-latest
needs: getMatrix
strategy:
fail-fast: false
matrix:
testPathPattern: ${{ fromJSON(needs.getMatrix.outputs.testPathPatterns) }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false
- name: Run server
run: |
./.github/scripts/runServer.sh
- name: Compare Snapshots - ${{ matrix.testPathPattern }}
continue-on-error: true
run: |
npm run test:func -- --testPathPattern "${{ matrix.testPathPattern }}"
# - name: Collect Diffs and Upload to Imgur
# run: |
# ./scripts/snapshot-tests/collect-diffs.sh
compareSnapshotsV2:
name: Compare V2
runs-on: ubuntu-latest
needs: getMatrix
strategy:
fail-fast: false
matrix:
testConfig: ${{ fromJSON(needs.getMatrix.outputs.testConfigs) }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false
- name: Run server
run: |
./.github/scripts/runServerV2.sh
- name: Compare Snapshots - ${{ matrix.testConfig }}
continue-on-error: true
run: |
CONFIG_PATH=${{ matrix.testConfig }} npm run test:func:snapshots
# - name: Collect Diffs and Upload to Imgur
# run: |
# ./scripts/snapshot-tests/collect-diffs-v2.sh