-
Notifications
You must be signed in to change notification settings - Fork 12
75 lines (61 loc) · 2.72 KB
/
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: pr
on: pull_request
jobs:
changed-files:
runs-on: ubuntu-20.04
steps:
- name: Checkout 🛎
# https://github.com/actions/checkout
uses: actions/checkout@v3
with:
fetch-depth: 20
- name: Install dependencies 📦
# https://github.com/cypress-io/github-action
uses: cypress-io/github-action@v5
with:
runTests: false
- name: Print dependencies between tests and utils 💻
run: npm run deps
- name: Print files changed against the parent of this branch 🌳
run: |
git --version
git status
git fetch
git log --pretty=format:"%h %s" --graph --since=1.month
git merge-base origin/main HEAD
git diff --name-only --diff-filter=AMR $(git merge-base origin/main HEAD)..
- name: Print specs changed against the parent of this branch 🌳
# and set GitHub Actions output
id: step1
run: node ./bin/find --branch main --parent --set-gha-outputs
- name: Print set outputs
run: echo ${{ steps.step1.outputs.changedSpecsN }} ${{ steps.step1.outputs.changedSpecs }}
- name: Print changed specs if you trace imports and requires 🔭
# in the folder "cypress"
id: step2
run: node ./bin/find --branch main --parent --trace-imports cypress --set-gha-outputs
- name: Print set outputs
run: echo ${{ steps.step2.outputs.changedSpecsN }} ${{ steps.step2.outputs.changedSpecs }}
- name: Saving traced dependencies
run: node ./bin/find --branch main --parent --trace-imports cypress --cache-trace --time-trace
- name: Loading cached traced dependencies
run: node ./bin/find --branch main --parent --trace-imports cypress --cache-trace
- name: Test cypress.json project (Cypress v9)
run: npm run demo-tests --prefix test-json
- name: Find tests in subfolder
run: npm run demo-subfolder
- name: Demo test names in Markdown format and put into job summary 💻
run: npm run demo-names-markdown >> "$GITHUB_STEP_SUMMARY"
- name: Show specs with tags
id: find-tagged
run: node ./bin/find --tagged @user --set-gha-outputs
- name: Print the found specs with tags
run: |
echo '${{ steps.find-tagged.outputs.taggedSpecsN }} Specs with tests tagged user' >> "$GITHUB_STEP_SUMMARY"
echo '${{ steps.find-tagged.outputs.taggedSpecs }}' >> "$GITHUB_STEP_SUMMARY"
- name: Confirm we can run specs in subfolder
uses: cypress-io/github-action@v5
with:
# we have already installed all dependencies above
install: false
config-file: mocks/my-app/e2e/cypress.config.js