Repository navigation
96 lines (80 loc) · 2.78 KB
/
Copy pathci.yml
File metadata and controls
96 lines (80 loc) · 2.78 KB
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
name: CI
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
# A newer push to the same pull request supersedes the older run. Pushes to
# main never share a group, so each main commit keeps a complete run.
concurrency:
group: ci-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
# Exact Wright release the smoke jobs install. Bump deliberately.
WRIGHT_SMOKE_VERSION: 0.29.0
jobs:
lint:
name: actionlint and shellcheck
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v7
# The image bundles shellcheck, so actionlint also checks `run:` scripts.
- name: actionlint
run: docker run --rm -v "$PWD:/repo" -w /repo rhysd/actionlint:1.7.12 -color
- name: shellcheck
run: shellcheck -S warning scripts/*.sh
test:
name: Helper tests
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Test the helper script
run: scripts/test-setup-wright.sh
smoke:
name: Smoke (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-15, windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Install Wright through the Action
id: first
uses: ./
with:
version: ${{ env.WRIGHT_SMOKE_VERSION }}
- name: Move the installed copy aside so the cache must restore it
shell: bash
run: mv "$RUNNER_TEMP/setup-wright" "$RUNNER_TEMP/setup-wright-first"
- name: Install Wright again from the cache
id: second
uses: ./
with:
version: ${{ env.WRIGHT_SMOKE_VERSION }}
# A fork PR has a read-only cache token, so it cannot seed the cache.
- name: Check the second install used the cache
if: github.event.pull_request.head.repo.fork != true
shell: bash
env:
CACHE_HIT: ${{ steps.second.outputs.cache-hit }}
run: |
[[ "$CACHE_HIT" == true ]] || { echo "::error::expected a cache hit"; exit 1; }
- name: Check the installed version
shell: bash
run: |
wright --version | tee "$RUNNER_TEMP/version.txt"
grep -Fq "$WRIGHT_SMOKE_VERSION" "$RUNNER_TEMP/version.txt"
- name: Run Wright as an ordinary step
shell: bash
run: |
printf 'rule ("setup smoke") {\n event {\n Ongoing - Global;\n }\n actions {\n Disable Inspector Recording;\n }\n}\n' > "$RUNNER_TEMP/smoke.ws"
wright check "$RUNNER_TEMP/smoke.ws"
grep -Fq 'PASS' "$GITHUB_STEP_SUMMARY"