-
Notifications
You must be signed in to change notification settings - Fork 464
154 lines (149 loc) · 6.39 KB
/
ci.yml
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
name: Continuous Integration
on:
push:
branches: [ master, 'version-*' ]
pull_request:
workflow_dispatch:
inputs:
android:
type: boolean
default: 'true'
windows:
type: boolean
default: 'true'
macos:
type: boolean
default: 'true'
ios:
type: boolean
default: 'true'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
MAKEFLAGS: ${{ (github.repository == 'numworks/epsilon-internal') && '-j32' || '-j2' }}
jobs:
android:
runs-on: ubuntu-latest
if: ${{ (github.repository != 'numworks/epsilon-internal' || github.event.inputs.android == 'true') }}
steps:
- run: $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "ndk;22.1.7171670"
- uses: actions/checkout@v3
- run: build/setup.sh --only-simulator
- run: make PLATFORM=simulator TARGET=android ASSERTIONS=1 test.apk
- run: make PLATFORM=simulator TARGET=android ASSERTIONS=1 epsilon.apk
- uses: actions/upload-artifact@master
with:
name: epsilon-android.apk
path: output/release/simulator/android/epsilon.apk
device:
runs-on: ${{ (github.repository == 'numworks/epsilon-internal') && 'self-hosted' || 'ubuntu-latest' }}
strategy:
matrix:
model: [n0110, n0115, n0120]
steps:
- uses: numworks/setup-arm-toolchain@latest
- uses: actions/checkout@v3
with:
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
submodules: ${{ secrets.PAT != null }}
- run: build/setup.sh
- name: Check for epsilon-core
id: epsilon-core
run: "[[ -e ion/src/device/epsilon-core/.gitignore ]]"
continue-on-error: true
- name: Disable epsilon-core submodule
if: ${{ steps.epsilon-core.outcome == 'success' }}
run: mv ion/src/device/epsilon-core ion/src/device/epsilon-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: 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 epsilon-core submodule
if: ${{ steps.epsilon-core.outcome == 'success' }}
run: mv ion/src/device/epsilon-core-disable ion/src/device/epsilon-core
- if: ${{ steps.epsilon-core.outcome == 'success' }}
run: make MODEL=${{ matrix.model }} epsilon.dfu
- if: ${{ steps.epsilon-core.outcome == 'success' }}
run: make MODEL=${{ matrix.model }} flasher.dfu
- if: ${{ steps.epsilon-core.outcome == 'success' }}
run: make MODEL=${{ matrix.model }} bench.ram.dfu
windows:
runs-on: windows-latest
if: ${{ (github.repository != 'numworks/epsilon-internal' || github.event.inputs.windows == 'true') }}
defaults:
run:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@v2
with:
update: true
install: >-
git
mingw-w64-x86_64-arm-none-eabi-gcc
- uses: actions/checkout@v3
- run: build/setup.sh
- run: make PLATFORM=simulator ASSERTIONS=1 epsilon.exe
- run: make PLATFORM=simulator ASSERTIONS=1 test.exe
- run: ./output/release/simulator/windows/test.exe --headless --limit-stack-usage
- run: make -j8 userland.A.elf
- uses: actions/upload-artifact@v3
with:
name: epsilon-windows.exe
path: output/release/simulator/windows/epsilon.exe
web:
runs-on: ${{ (github.repository == 'numworks/epsilon-internal') && 'self-hosted' || 'ubuntu-latest' }}
steps:
- uses: numworks/setup-emscripten@latest
with:
sdk: 3.1.43
- uses: actions/checkout@v3
- run: build/setup.sh --only-simulator
- run: make PLATFORM=simulator TARGET=web ASSERTIONS=1 epsilon.html test.js
- run: timeout 5m node output/release/simulator/web/test.js --headless --limit-stack-usage
- uses: actions/upload-artifact@v3
if: ${{ (github.repository != 'numworks/epsilon-internal') }}
with:
name: epsilon.html
path: output/release/simulator/web/epsilon.html
retention-days: 7
linux:
runs-on: ${{ (github.repository == 'numworks/epsilon-internal') && 'self-hosted' || 'ubuntu-latest' }}
steps:
- uses: numworks/setup-llvm@latest
- uses: actions/checkout@v3
- run: build/setup.sh --only-simulator
- run: make PLATFORM=simulator ASAN=1 TIDY=1 ASSERTIONS=1 epsilon.bin test.bin
- run: output/release/simulator/linux/test.bin --headless --limit-stack-usage
- uses: actions/upload-artifact@v3
if: ${{ (github.repository != 'numworks/epsilon-internal') }}
with:
name: epsilon-linux.bin
path: output/release/simulator/linux/epsilon.bin
macos:
runs-on: macOS-latest
if: ${{ (github.repository != 'numworks/epsilon-internal' || github.event.inputs.macos == 'true') }}
steps:
- uses: actions/checkout@v3
- run: build/setup.sh --only-simulator
- run: make PLATFORM=simulator ASSERTIONS=1 ARCH=x86_64 test.bin
- run: output/release/simulator/macos/x86_64/test.bin --headless --limit-stack-usage
- run: make PLATFORM=simulator ASSERTIONS=1 epsilon.app
- uses: actions/upload-artifact@v3
with:
name: epsilon-macos.zip
path: output/release/simulator/macos/epsilon.app
ios:
runs-on: macOS-latest
if: ${{ (github.repository != 'numworks/epsilon-internal' || github.event.inputs.ios == 'true') }}
steps:
- uses: actions/checkout@v3
- run: build/setup.sh --only-simulator
- run: make PLATFORM=simulator TARGET=ios EPSILON_TELEMETRY=0 ASSERTIONS=1 epsilon.ipa
- run: make PLATFORM=simulator TARGET=ios EPSILON_TELEMETRY=0 ASSERTIONS=1 test.ipa
- run: make PLATFORM=simulator TARGET=ios EPSILON_TELEMETRY=0 APPLE_PLATFORM=ios-simulator
- uses: actions/upload-artifact@v3
with:
name: epsilon-ios.ipa
path: output/release/simulator/ios/epsilon.ipa