Repository navigation
226 lines (199 loc) · 7.44 KB
/
Copy pathtest.yml
File metadata and controls
226 lines (199 loc) · 7.44 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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
name: tests
on:
push:
branches: [master]
pull_request:
workflow_dispatch:
concurrency:
group: tests-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Elixir ${{ matrix.elixir }} / OTP ${{ matrix.otp }}
runs-on: ubuntu-latest
env:
MIX_ENV: test
strategy:
fail-fast: false
matrix:
include:
- elixir: '1.19'
otp: '28'
steps:
- uses: actions/checkout@v4
# mob.adopt's native (--android/--ios) tests render from mob_new's
# templates — mob_new is the single source, not duplicated here. Provide
# a mob_new checkout so MobDev.Adopt.Generator resolves them via
# MOB_NEW_DIR (mirrors a user having the mob_new archive installed).
- name: Checkout mob_new (native adopt templates)
uses: actions/checkout@v4
with:
repository: GenericJam/mob_new
path: mob_new
- uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- name: Cache deps + _build
uses: actions/cache@v4
with:
path: |
deps
_build
key: mix-${{ runner.os }}-${{ matrix.elixir }}-${{ matrix.otp }}-${{ hashFiles('**/mix.lock') }}
restore-keys: mix-${{ runner.os }}-${{ matrix.elixir }}-${{ matrix.otp }}-
- run: mix deps.get
- run: mix deps.compile
- run: mix compile --warnings-as-errors
# Some HotPush tests inspect `_build/dev/lib/*/ebin/*.beam` to verify
# which runtime BEAMs the `mix mob.push` helper would ship to a device.
# Under MIX_ENV=test the dev tree doesn't exist; pre-populate it so
# those tests have something to look at.
- name: Compile :dev tree (for HotPush tests)
env:
MIX_ENV: dev
run: mix compile
- name: Format check
run: mix format --check-formatted
- name: Credo (strict)
run: mix credo --strict
- name: Tests
env:
# mob.adopt native tests resolve mob_new's templates from this checkout.
MOB_NEW_DIR: ${{ github.workspace }}/mob_new
# `:macos_only` — tests that shell out to /usr/libexec/PlistBuddy
# and similar macOS-bound tools.
# `:requires_zig` — run by the macOS `zig` job below, which has the
# pinned Zig and reads Mach-O objects with `nm`.
# Both run by default on a maintainer's laptop; CI explicitly skips.
run: mix test --exclude macos_only --exclude requires_zig
# MOB-201: `mix mob.doctor`'s Xcode / iOS SDK / iPhone Duo rows, run against
# real Xcodes selected through DEVELOPER_DIR (the same resolution
# MobDev.NativeBuild's `xcrun --show-sdk-path` uses). The 27.1 row is the
# only Xcode 27.1 + iOS 27.1 SDK the project can run today: GitHub's
# `xcode-27` image (preview) has it; it has no iOS 27.1 simulator runtime and
# no iPhone Duo simulator. The 26.6 row keeps the Xcode 26 lane alive.
xcode:
name: Xcode ${{ matrix.xcode }} (${{ matrix.runner }})
runs-on: ${{ matrix.runner }}
env:
MIX_ENV: test
HOMEBREW_NO_AUTO_UPDATE: '1'
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
MOB_EXPECT_XCODE: ${{ matrix.xcode }}
MOB_EXPECT_IOS_SDK: ${{ matrix.ios_sdk }}
MOB_EXPECT_DUO: ${{ matrix.duo }}
strategy:
fail-fast: false
matrix:
include:
- runner: xcode-27
xcode: '27.1'
ios_sdk: '27.1'
duo: ok
- runner: xcode-27
xcode: '27.0'
ios_sdk: '27.0'
duo: warn
- runner: macos-26
xcode: '26.6'
ios_sdk: '26.5'
duo: warn
steps:
- uses: actions/checkout@v4
# erlef/setup-beam has no macOS support; Homebrew's bottles are recent
# enough for mob_dev's `elixir: "~> 1.19"`.
- name: Install Elixir
run: |
brew install elixir
mix local.hex --force
mix local.rebar --force
- name: Cache deps + _build
uses: actions/cache@v4
with:
path: |
deps
_build
key: mix-${{ matrix.runner }}-${{ hashFiles('**/mix.lock') }}
restore-keys: mix-${{ matrix.runner }}-
- run: xcodebuild -version && xcrun --sdk iphoneos --show-sdk-version
- run: mix deps.get
- run: mix test --only xcode_live test/mob_dev/xcode_live_test.exs
# `:requires_zig` tests compile generated driver tables and plugin NIFs with
# the pinned Zig (read from .tool-versions so CI can't drift from it). macOS,
# because the iOS objects are Mach-O and the test reads them with `nm`.
zig:
name: Zig (requires_zig)
runs-on: macos-26
env:
MIX_ENV: test
HOMEBREW_NO_AUTO_UPDATE: '1'
steps:
- uses: actions/checkout@v4
- name: Install Elixir
run: |
brew install elixir
mix local.hex --force
mix local.rebar --force
- name: Zig version from .tool-versions
id: zig
run: echo "version=$(awk '$1 == "zig" {print $2}' .tool-versions)" >> "$GITHUB_OUTPUT"
- uses: mlugg/setup-zig@v2
with:
version: ${{ steps.zig.outputs.version }}
# A cached .zig-cache holds configure results that name the zig
# binary by its absolute path, which changes every run.
use-cache: false
# The Xcode 26.6 lane's cache (same runner, same MIX_ENV). On a cold
# cache vix's precompiled downloads failed on this runner (NIF :enoent,
# then header_too_long fetching libvips), and the source fallback needs
# glib. This job depends on that lane keeping the cache warm.
- name: Cache deps + _build
uses: actions/cache/restore@v4
with:
path: |
deps
_build
key: mix-macos-26-${{ hashFiles('**/mix.lock') }}
restore-keys: mix-macos-26-
- run: mix deps.get
- run: mix test --only requires_zig
security_scan:
name: Security scan
needs: test
runs-on: ubuntu-latest
if: always()
# Informational: a finding shouldn't block the workflow gate while we
# establish a baseline. Flip to `--strict` once we've triaged what's
# already in the dep tree.
continue-on-error: true
env:
MIX_ENV: test
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
elixir-version: '1.19'
otp-version: '28'
- name: Cache deps + _build (reuse test job's key)
uses: actions/cache@v4
with:
path: |
deps
_build
key: mix-${{ runner.os }}-1.19-28-${{ hashFiles('**/mix.lock') }}
restore-keys: mix-${{ runner.os }}-1.19-28-
- run: mix deps.get
- run: mix deps.compile
# osv-scanner is an optional external tool the scanner consumes when
# available. Missing tools are reported as soft warnings (not failures).
- name: Install osv-scanner
run: |
curl -sSfL https://github.com/google/osv-scanner/releases/latest/download/osv-scanner_linux_amd64 \
-o /usr/local/bin/osv-scanner
chmod +x /usr/local/bin/osv-scanner
osv-scanner --version
- name: mix mob.security_scan
# The hex_deps layer applies to mob_dev itself; the gradle / swift /
# bundled_runtime layers no-op (mob_dev has no native surface).
run: mix mob.security_scan