-
Notifications
You must be signed in to change notification settings - Fork 24
115 lines (96 loc) · 3.45 KB
/
Copy pathexamples_build_test.yml
File metadata and controls
115 lines (96 loc) · 3.45 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
name: Examples - Build & test
on:
push:
branches: ["**"]
paths:
- "examples/game-of-life/**"
- "examples/hello-popcorn/**"
- "examples/iex-wasm/**"
- "popcorn/**"
- "scripts/build-beam.sh"
- "scripts/build-openssl.sh"
- "scripts/patch-beam.sh"
- "scripts/runtime-manifest.sh"
- "scripts/_common.sh"
- ".github/workflows/examples_build_test.yml"
- ".github/actions/build-otp-wasm/action.yml"
- ".github/actions/setup-playwright/action.yml"
- "pnpm-workspace.yaml"
- "pnpm-lock.yaml"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
CI: true
jobs:
build:
name: Build & test
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
# Produces popcorn/out with the OTP/BEAM Wasm runtime (cached across runs).
- name: Build OTP/BEAM for Wasm
uses: ./.github/actions/build-otp-wasm
with:
host-otp-version: &host_otp "29.0.6"
build-mode: debug
with-crypto: "false"
# The example is compiled to BEAM that runs on the OTP 29 / Elixir 1.20.4
# runtime shipped in the Wasm VM, so the host toolchain must match it.
# (Note: repo-wide mise.toml pins the older AtomVM toolchain, 1.17/OTP 26.)
- name: Set up Elixir
uses: erlef/setup-beam@fc68ffb90438ef2936bbb3251622353b3dcb2f93 # v1.24.0
with:
elixir-version: "1.20.4"
otp-version: *host_otp
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
# Node 24.16.0 broke the zip extraction (and subsequently, Playwright).
# See https://github.com/nodejs/node/issues/63487.
node-version: "24.15.0"
cache: "pnpm"
cache-dependency-path: pnpm-lock.yaml
- name: Install JS dependencies
run: pnpm install
# Bundles @swmansion/popcorn and copies the runtime from popcorn/out
# into its dist/assets (consumed by the example's esbuild plugin).
- name: Build Popcorn JS package
run: pnpm -F ./popcorn/js build
- name: Setup Playwright
uses: ./.github/actions/setup-playwright
with:
version: "1.62.0"
- name: Run Game of Life unit tests
run: mix test
working-directory: examples/game-of-life
- name: Run Hello Popcorn unit tests
run: mix test
working-directory: examples/hello-popcorn
- name: Run Game of Life e2e tests
run: pnpm test
working-directory: examples/game-of-life/assets
- name: Run Hello Popcorn e2e tests
run: pnpm test
working-directory: examples/hello-popcorn/assets
- name: Run IEx Wasm e2e tests
run: pnpm test
working-directory: examples/iex-wasm/assets
- name: Upload Playwright test artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: examples-playwright-results
path: |
examples/game-of-life/assets/playwright-report/
examples/game-of-life/assets/test-results/
examples/hello-popcorn/assets/playwright-report/
examples/hello-popcorn/assets/test-results/
examples/iex-wasm/assets/playwright-report/
examples/iex-wasm/assets/test-results/
if-no-files-found: ignore