-
Notifications
You must be signed in to change notification settings - Fork 0
153 lines (134 loc) · 6.05 KB
/
ci.yml
File metadata and controls
153 lines (134 loc) · 6.05 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: CI
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
# Skip stale runs when a PR gets pushed rapidly.
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
# Fast gate: format + build + typecheck + lint. `yarn build` runs first so
# lint/typecheck replay from the turbo cache instead of triggering their
# own `^build` dependency.
build:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Format check
run: yarn format
- name: Build
run: yarn build --output-logs=new-only
- name: Typecheck
run: yarn typecheck --output-logs=new-only
- name: Lint
run: yarn lint --output-logs=new-only
integration:
runs-on: ubuntu-latest
needs: build
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Run @aztec-kit/contracts-aztec integration tests
run: yarn workspace @aztec-kit/contracts-aztec test
- name: Run @aztec-kit/embedded-wallet integration tests
run: yarn workspace @aztec-kit/embedded-wallet test
# Playwright e2e tests. Runs on the host runner (not in a container) so
# it shares the same actions/cache scope as `build` + `integration`: yarn
# + node_modules cache hit, Aztec CLI cache hit, noir artifacts cache hit.
#
# Playwright's apt deps are installed via `cache-apt-pkgs-action`, which
# caches the downloaded .debs + dpkg state so the ~2min cold install
# drops to a few seconds on subsequent runs. The Chromium binary itself
# lives in ~/.cache/ms-playwright and is cached by the setup action.
e2e:
runs-on: ubuntu-latest
needs: build
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
# Hard guarantee that no test-state checkpoints leak in from any cache
# path widening. `e2e/.state/` is per-run scratch: contract addresses
# for the current local-network spawn, derived swap-admin keys, etc.
# Nothing in CI should ever resume from a prior run's `.state/`.
- name: Ensure e2e/.state is clean
run: rm -rf e2e/.state
# Full playwright dep set (chromium + firefox + webkit + tools) so
# adding a browser later is a one-line change in the test config —
# no need to revisit this list. Pulled from playwright-core's
# registry/nativeDeps.js for ubuntu24.04-x64; bump `version` when the
# list changes to bust the cache.
- name: Install Playwright system deps
uses: awalsh128/cache-apt-pkgs-action@v1
with:
version: playwright-deps-v2
packages: >-
fonts-freefont-ttf fonts-ipafont-gothic fonts-liberation
fonts-noto-color-emoji fonts-tlwg-loma-otf fonts-unifont
fonts-wqy-zenhei gstreamer1.0-libav gstreamer1.0-plugins-bad
gstreamer1.0-plugins-base gstreamer1.0-plugins-good libasound2t64
libatk-bridge2.0-0t64 libatk1.0-0t64 libatomic1 libatspi2.0-0t64
libavcodec60 libavif16 libcairo-gobject2 libcairo2 libcups2t64
libdbus-1-3 libdrm2 libenchant-2-2 libepoxy0 libevent-2.1-7t64
libflite1 libfontconfig1 libfreetype6 libgbm1 libgdk-pixbuf-2.0-0
libgles2 libglib2.0-0t64 libgstreamer-gl1.0-0
libgstreamer-plugins-bad1.0-0 libgstreamer-plugins-base1.0-0
libgstreamer1.0-0 libgtk-3-0t64 libgtk-4-1 libharfbuzz-icu0
libharfbuzz0b libhyphen0 libicu74 libjpeg-turbo8 liblcms2-2
libmanette-0.2-0 libnspr4 libnss3 libopus0 libpango-1.0-0
libpangocairo-1.0-0 libpng16-16t64 libsecret-1-0 libvpx9
libwayland-client0 libwayland-egl1 libwayland-server0 libwebp7
libwebpdemux2 libwoff1 libx11-6 libx11-xcb1 libx264-164
libxcb-shm0 libxcb1 libxcomposite1 libxcursor1 libxdamage1
libxext6 libxfixes3 libxi6 libxkbcommon0 libxml2 libxrandr2
libxrender1 libxslt1.1 xfonts-cyrillic xfonts-scalable xvfb
# Cache the downloaded browser binaries. Keyed on the @playwright/test
# version so any bump busts the cache automatically (Playwright pins a
# specific chromium build per release and refuses to use a mismatched
# one). Reads the resolved version from the `yarn.lock` entry, which
# exists regardless of how yarn lays down node_modules (hoisted vs not).
- name: Resolve Playwright version
id: playwright-version
shell: bash
run: |
VERSION=$(awk '/^"@playwright\/test@/{found=1; next} found && /version:/{print $2; exit}' yarn.lock | tr -d '"')
if [ -z "$VERSION" ]; then
echo "Failed to resolve @playwright/test version from yarn.lock" >&2
exit 1
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Cache Playwright browsers
id: playwright-cache
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}
- name: Install Playwright browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: yarn workspace @aztec-kit/e2e exec playwright install
- name: Run e2e tests
# --fail-on-flaky-tests makes Playwright exit 1 when a test passes only
# on retry. Default behaviour marks flakies as "passed" which hides
# real regressions.
run: yarn workspace @aztec-kit/e2e test --fail-on-flaky-tests
env:
CI: "1"
- name: Upload Playwright report
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-report
# html-report/ — Playwright's HTML report (traces, videos)
# playwright-report/aztec.log — our sidecar log (aztec node stdout/err)
path: |
e2e/html-report/
e2e/playwright-report/
retention-days: 7