-
Notifications
You must be signed in to change notification settings - Fork 76
42 lines (41 loc) · 1.35 KB
/
pr-e2e.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
name: E2E
on:
workflow_dispatch:
pull_request:
branches: [main, rc, dev]
jobs:
e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check diff for testable changes
id: diff-check
run: |
testable_changes="$(
git diff --name-only HEAD "$(
git merge-base HEAD origin/${{ github.base_ref }}
)" -- . ':!*.md*' ':!**/calcite-ui-icons/**'
)"
echo "changed files: $testable_changes"
# skip if there are only md changes
if [ -z "$testable_changes" ]; then
echo "SKIP=true" >> "$GITHUB_OUTPUT"
else
echo "SKIP=false" >> "$GITHUB_OUTPUT"
fi
- if: steps.diff-check.outputs.SKIP == 'false'
uses: actions/setup-node@v4
with:
node-version-file: package.json
- if: steps.diff-check.outputs.SKIP == 'false'
name: Run tests for testable changes
run: npm install && npm run build && npm run test
- if: steps.diff-check.outputs.SKIP == 'true'
name: Skip visual snapshots for non-testable changes
env:
GH_TOKEN: ${{ secrets.ADMIN_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
gh pr edit "$PR_NUMBER" --add-label "skip visual snapshots"