-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (112 loc) · 4.73 KB
/
Copy pathci.yml
File metadata and controls
131 lines (112 loc) · 4.73 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
name: CI
on:
push:
branches: [main]
tags: ['v*']
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install ARM toolchain
run: |
sudo apt-get update
sudo apt-get install -y gcc-arm-none-eabi
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Run host engine tests
run: make test
- name: Build device app (.nwa)
run: make
# `make` only produces a *relocatable* object, so it cannot fail on
# undefined symbols. The link that matters happens when the app is
# installed, against nwlink's eadk.o alone. Run it here: without this
# step a .nwa that no calculator can install still looks green.
- name: Verify the app links for the device
run: make verify-install
# Nothing checks these at link time: the 32 KiB userland stack is shared
# with Epsilon and invisible to the linker, and nwlink's offline RAM
# default (256K) is far more generous than the real external-app window.
- name: Check RAM and stack budgets
run: make check-budgets
# newlib-nano has no long-long printf and Kandinsky's font is limited;
# glibc and desktop fonts hide both from every other test.
- name: Check device-only source constraints
run: make check-source
- name: Upload nwa artifact
uses: actions/upload-artifact@v4
with:
name: rpn-nwa
path: output/rpn.nwa
if-no-files-found: error
# Replay tests/sim against the real app inside a real Epsilon. This is the
# only job that runs src/main.cpp itself, so the event loop, the keymap and
# the Toolbox menu are covered, with real fonts and the real external-app
# loader. Complements — does not replace — the build job: the simulator
# resolves libm/libstdc++ from the host process, so it cannot catch a broken
# device link, and its --limit-stack-usage caps at 128 KiB, not the device's
# 32 KiB.
simulator:
runs-on: ubuntu-latest
# Measured on a 4-vCPU runner: ~3.5 min to build Epsilon from scratch, ~20 s
# once the cache is warm. The cap is a backstop against a hung build, with
# room for Epsilon to grow — not a budget to fill.
timeout-minutes: 30
env:
# Pinned on purpose: the scenarios compare screenshots pixel for pixel, so
# an Epsilon font or layout change would fail them for no fault of ours.
# To move: bump this, run `make sim-test-update`, review every image.
# Must be a full 40-char SHA — actions/checkout treats a short one as a
# branch-name pattern and fails to find it.
EPSILON_REF: 72c8306f4fe3adf3bfc9c79802a39b80afb8e988
steps:
- uses: actions/checkout@v4
- name: Check out Epsilon
uses: actions/checkout@v4
with:
repository: 1e1/epsilon
ref: ${{ env.EPSILON_REF }}
path: epsilon-fork
# Epsilon vendors SDL under shared/ion/src/simulator/external/sdl and
# compiles it itself, linking only -lX11 -lXext -ldl -lpthread — so the X11
# dev packages are what matter here, not libsdl2-dev. freetype feeds the
# font rasterizer, python3-pil/lz4 and imagemagick the image pipeline.
- name: Install simulator build dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential python3 python3-pil python3-lz4 imagemagick \
pkg-config libfreetype-dev libx11-dev libxext-dev \
libpng-dev libjpeg-dev
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Cache the built Epsilon simulator
id: sim-cache
uses: actions/cache@v4
with:
path: epsilon-fork/epsilon/output
key: epsilon-linux-sim-${{ env.EPSILON_REF }}
- name: Build the Epsilon Linux simulator
if: steps.sim-cache.outputs.cache-hit != 'true'
working-directory: epsilon-fork/epsilon
run: make PLATFORM=linux -j"$(nproc)" epsilon.bin
- name: Build the app for the simulator
run: make PLATFORM=simulator
- name: Replay the RPN scenarios
working-directory: epsilon-fork/epsilon
run: |
python3 "$GITHUB_WORKSPACE/tests/sim/run.py" \
--epsilon "$PWD/output/release/linux/epsilon.bin" \
--nwb "$GITHUB_WORKSPACE/output/simulator/rpn.nwb"
# The diffs are the whole point when a scenario fails.
- name: Upload rendered screenshots and diffs
if: failure()
uses: actions/upload-artifact@v4
with:
name: sim-screenshots
path: tests/sim/got/
if-no-files-found: ignore