forked from numworks/epsilon
-
Notifications
You must be signed in to change notification settings - Fork 0
174 lines (165 loc) · 6.15 KB
/
ci.yml
File metadata and controls
174 lines (165 loc) · 6.15 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
name: Continuous Integration
on:
# Running CI on every push would be better, but ci performances are limited for now.
# push:
# branches: [ master, 'version-*' ]
pull_request:
paths-ignore:
- '**/*.md'
- 'poincare/doc/**'
- 'tests/**'
- '**/scandium/**'
- 'external_apps/**'
workflow_dispatch:
inputs:
device:
type: boolean
default: false
windows:
type: boolean
default: false
macos:
type: boolean
default: false
web:
type: boolean
default: false
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
MAKEFLAGS: -j2
jobs:
device:
timeout-minutes: 60
runs-on: ubuntu-latest
if: ${{ (fromJSON(github.event.inputs.device)) }}
strategy:
matrix:
model: [n0110, n0115, n0120]
env:
MAKEFLAGS: -j2
steps:
- uses: actions/checkout@v4
- name: Build container and define DOCKER_RUN
uses: ./.github/actions/docker-builder
- name: Check for core
id: core
run: '[[ -e ion/src/device/core ]]'
continue-on-error: true
- name: Disable core directory
if: ${{ steps.core.outcome == 'success' }}
run: mv ion/src/device/core ion/src/device/core-disable
- name: Build userlands
# Since both slots have the exact same amount of Flash reserved, it is pointless to build both the A and B elfs for every variant.
# As an exception, because we'll build epsilon.dfu that on both userland.A.elf and userland.B.elf, we still build those here
# TODO: It is also probably useless to build so many variants
run: $DOCKER_RUN "make MODEL=${{ matrix.model }} userland.A.elf userland.B.elf userland.allow3rdparty.A.elf userland.onboarding.A.elf userland.onboarding.allow3rdparty.A.elf userland.onboarding.update.A.elf userland.onboarding.beta.A.elf userland.onboarding.beta.allow3rdparty.A.elf"
- name: Restore core directory
if: ${{ steps.core.outcome == 'success' }}
run: mv ion/src/device/core-disable ion/src/device/core
- if: ${{ steps.core.outcome == 'success' }}
run: $DOCKER_RUN "make MODEL=${{ matrix.model }} epsilon.dfu"
- if: ${{ steps.core.outcome == 'success' }}
run: $DOCKER_RUN "make MODEL=${{ matrix.model }} flasher.dfu"
- if: ${{ steps.core.outcome == 'success' }}
run: $DOCKER_RUN "make MODEL=${{ matrix.model }} bench.ram.dfu"
windows:
timeout-minutes: 60
runs-on: windows-latest
if: ${{ (fromJSON(github.event.inputs.windows)) }}
defaults:
run:
shell: msys2 {0}
env:
MAKEFLAGS: '-j2'
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: mingw64
update: true
install: >-
git
mingw-w64-x86_64-arm-none-eabi-gcc
- uses: actions/checkout@v4
- run: build/setup.sh
- run: make PLATFORM=simulator ASSERTIONS=1 epsilon.exe
- run: make PLATFORM=simulator ASSERTIONS=1 test.exe
- run: ./output/debug/optimized/windows/test.exe --headless --limit-stack-usage
- run: make -j8 userland.A.elf
- uses: actions/upload-artifact@v4
with:
name: epsilon-windows.exe
path: output/debug/optimized/windows/epsilon.exe
linux:
timeout-minutes: 60
runs-on: ubuntu-latest
env:
MAKEFLAGS: -j2
steps:
- uses: actions/checkout@v4
- name: Build container and define DOCKER_RUN
uses: ./.github/actions/docker-builder
# TODO_PCJ: Add ASAN=1 and TIDY=1
- name: Build epsilon.bin and test.bin
run: $DOCKER_RUN "make TOOLCHAIN=host-clang PLATFORM=simulator ASSERTIONS=1 epsilon.bin test.bin"
- name: Run unit tests (in parallel)
run: |
$DOCKER_RUN "parallel --halt now,fail=1 --keep-order output/debug/optimized/linux/test.bin --headless --limit-stack-usage --number-of-chunks 32 --chunk-id {} ::: \$(seq 0 31)"
id: run-tests
continue-on-error: true
- name: Run unit tests sequentially (if parallel run failed)
if: steps.run-tests.outcome == 'failure'
run: $DOCKER_RUN "rm -f core; output/debug/optimized/linux/test.bin --headless --limit-stack-usage || (eu-stack --core core; exit 1)"
- uses: actions/upload-artifact@v4
with:
name: epsilon-linux.bin
path: output/debug/optimized/linux/epsilon.bin
macos:
timeout-minutes: 60
runs-on: macOS-latest
if: ${{ (fromJSON(github.event.inputs.macos)) }}
env:
MAKEFLAGS: '-j2'
steps:
- uses: actions/checkout@v4
- run: build/setup.sh --only-simulator
- run: make PLATFORM=simulator ASSERTIONS=1 ARCH=x86_64 test.bin
- run: output/debug/optimized/macos/x86_64/test.bin --headless --limit-stack-usage
- run: make PLATFORM=simulator ASSERTIONS=1 epsilon.app
- uses: actions/upload-artifact@v4
with:
name: epsilon-macos.zip
path: output/debug/optimized/macos/epsilon.app
poincarejs:
timeout-minutes: 60
runs-on: ubuntu-latest
env:
MAKEFLAGS: -j2
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Read Emscripten version
run: echo "EMSDK_VERSION=$(cat .emsdk-version)" >> $GITHUB_ENV
- name: Download emscripten
uses: numworks/setup-emscripten@latest
with:
sdk: ${{ env.EMSDK_VERSION }}
- name: Setup the environment
run: build/setup.sh --only-simulator
- name: Run tests with ASSERTIONS=1
run: make -j8 -f poincare/poincarejs/Makefile PLATFORM=foxglove ASSERTIONS=1 poincare.js.run
# Ensures that minification did not break the code
- name: Run tests with ASSERTIONS=0
run: make -j8 -f poincare/poincarejs/Makefile PLATFORM=foxglove ASSERTIONS=0 poincare.js.run
- name: Try building the whole zipped file
run: make -f poincare/poincarejs/Makefile
- uses: actions/upload-artifact@v4
with:
name: poincarejs.zip
path: output/release/foxglove/poincarejs.zip
retention-days: 7
coverage:
name: Code Coverage
needs: linux
uses: ./.github/workflows/code_coverage.yml