Skip to content

Commit 98508cf

Browse files
authored
Standardize dev and CI workflows with Just (#901)
1 parent 804a4e8 commit 98508cf

9 files changed

Lines changed: 323 additions & 90 deletions

File tree

.github/workflows/android.yml

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,22 @@ jobs:
2828
run: chmod +x gradlew
2929
working-directory: android
3030

31+
- uses: taiki-e/install-action@v2
32+
with:
33+
tool: just
34+
3135
- name: Install cargo-ndk
3236
run: cargo install cargo-ndk
3337

3438
- name: Touch local.properties (required for build)
3539
run: echo 'stadiaApiKey=' > local.properties
3640
working-directory: android
3741

38-
- name: Run ktfmtFormat
39-
run: ./gradlew ktfmtCheck
40-
working-directory: android
41-
42+
- name: Run ktfmtCheck
43+
run: just format-android --check
44+
4245
- name: Build with Gradle
43-
run: ./gradlew build
44-
working-directory: android
46+
run: just build-android
4547

4648
test:
4749
runs-on: ubuntu-latest
@@ -68,6 +70,10 @@ jobs:
6870
run: chmod +x gradlew
6971
working-directory: android
7072

73+
- uses: taiki-e/install-action@v2
74+
with:
75+
tool: just
76+
7177
- name: Install cargo-ndk
7278
run: cargo install cargo-ndk
7379

@@ -76,8 +82,7 @@ jobs:
7682
working-directory: android
7783

7884
- name: Unit test
79-
run: ./gradlew test
80-
working-directory: android
85+
run: just test-android-unit
8186

8287
- name: 'Upload Artifact'
8388
uses: actions/upload-artifact@v4
@@ -114,6 +119,10 @@ jobs:
114119
run: chmod +x gradlew
115120
working-directory: android
116121

122+
- uses: taiki-e/install-action@v2
123+
with:
124+
tool: just
125+
117126
- name: Install cargo-ndk
118127
run: cargo install cargo-ndk
119128

@@ -122,8 +131,7 @@ jobs:
122131
working-directory: android
123132

124133
- name: Verify snapshots
125-
run: ./gradlew verifyPaparazziDebug
126-
working-directory: android
134+
run: just test-android-snapshots
127135

128136
- name: 'Upload Artifact'
129137
uses: actions/upload-artifact@v4
@@ -161,6 +169,10 @@ jobs:
161169
run: chmod +x gradlew
162170
working-directory: android
163171

172+
- uses: taiki-e/install-action@v2
173+
with:
174+
tool: just
175+
164176
- name: Install cargo-ndk
165177
run: cargo install cargo-ndk
166178

@@ -181,8 +193,7 @@ jobs:
181193
avd-name: ubuntu-latest-x86_64-aosp-atd-30
182194
arch: x86_64
183195
target: aosp_atd
184-
script: ./gradlew connectedCheck
185-
working-directory: android
196+
script: just test-android-connected
186197

187198
- name: 'Upload Artifact'
188199
uses: actions/upload-artifact@v4

.github/workflows/ios-release.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@ jobs:
2222
with:
2323
xcode-version: '16.0'
2424

25+
- uses: taiki-e/install-action@v2
26+
with:
27+
tool: just
28+
2529
- name: Build iOS XCFramework
26-
run: ./build-ios.sh --release
27-
working-directory: common
30+
run: just build-ios --release
2831

2932
- uses: stefanzweifel/git-auto-commit-action@v5
3033

.github/workflows/ios.yml

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@ jobs:
1616
- name: Checkout repo
1717
uses: actions/checkout@v6
1818

19+
- uses: taiki-e/install-action@v2
20+
with:
21+
tool: just
22+
1923
- name: Check format
2024
id: check-format
21-
run: swiftformat . --lint
25+
run: just format-apple --check
2226

2327
- name: Recommend swiftformat update on failure
2428
if: ${{ failure() && steps.check-format.outcome == 'failure' }}
@@ -55,12 +59,15 @@ jobs:
5559
with:
5660
xcode-version: '26.3'
5761

62+
- uses: taiki-e/install-action@v2
63+
with:
64+
tool: just
65+
5866
- name: Build iOS XCFramework
59-
run: ./build-ios.sh --release
60-
working-directory: common
67+
run: just build-ios --release
6168

6269
- name: Ensure that Package.swift is NOT configured for local development at this stage (easy to forget)
63-
run: sed -i '' 's/let useLocalFramework = true/let useLocalFramework = false/' Package.swift
70+
run: just set-package-swift-release
6471

6572
- name: Detect changed files (it is easy to forget about ferrostar.swift)
6673
run: |
@@ -102,8 +109,12 @@ jobs:
102109
- name: Checkout repo
103110
uses: actions/checkout@v6
104111

112+
- uses: taiki-e/install-action@v2
113+
with:
114+
tool: just
115+
105116
- name: Configure Package.swift for local development
106-
run: sed -i '' 's/let useLocalFramework = false/let useLocalFramework = true/' Package.swift
117+
run: just set-package-swift-local
107118

108119
- name: Download libferrostar-rs.xcframework
109120
uses: actions/download-artifact@v4
@@ -143,22 +154,17 @@ jobs:
143154
group: ${{ github.workflow }}-${{ github.ref }}-ios-test
144155
cancel-in-progress: true
145156
needs: build-ferrostar
146-
strategy:
147-
matrix:
148-
scheme: [
149-
FerrostarCore-Package
150-
]
151-
destination: [
152-
# TODO: Add more destinations
153-
'platform=iOS Simulator,name=iPhone 17 Pro,OS=26.2'
154-
]
155157

156158
steps:
157159
- name: Checkout repo
158160
uses: actions/checkout@v6
159161

162+
- uses: taiki-e/install-action@v2
163+
with:
164+
tool: just
165+
160166
- name: Configure Package.swift for local development
161-
run: sed -i '' 's/let useLocalFramework = false/let useLocalFramework = true/' Package.swift
167+
run: just set-package-swift-local
162168

163169
- name: Download libferrostar-rs.xcframework.
164170
uses: actions/download-artifact@v4
@@ -177,8 +183,8 @@ jobs:
177183
- name: Install xcbeautify
178184
run: brew install xcbeautify
179185

180-
- name: Test ${{ matrix.scheme }} on ${{ matrix.destination }}
181-
run: xcodebuild -scheme ${{ matrix.scheme }} test -skipMacroValidation -destination '${{ matrix.destination }}' -resultBundlePath ${{ matrix.scheme }}.xcresult | xcbeautify && exit ${PIPESTATUS[0]}
186+
- name: Test FerrostarCore-Package
187+
run: just test-ios --ci
182188

183189
- name: 'Upload Package.swift Artifact'
184190
uses: actions/upload-artifact@v4
@@ -191,6 +197,6 @@ jobs:
191197
uses: actions/upload-artifact@v4
192198
if: always()
193199
with:
194-
name: ${{ matrix.scheme }}.xcresult
195-
path: ${{ matrix.scheme }}.xcresult
200+
name: FerrostarCore-Package.xcresult
201+
path: FerrostarCore-Package.xcresult
196202
retention-days: 5

.github/workflows/npm-publish.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ jobs:
2222
- name: Install wasm-pack
2323
run: cargo install wasm-pack
2424

25+
- uses: taiki-e/install-action@v2
26+
with:
27+
tool: just
28+
2529
- name: Set up Node.js
2630
uses: actions/setup-node@v4
2731
with:
@@ -33,8 +37,7 @@ jobs:
3337
working-directory: web
3438

3539
- name: Build
36-
run: npm run build
37-
working-directory: web
40+
run: just build-web
3841

3942
- name: Update package.json with the public package refs
4043
run: ./update-package-json.sh

.github/workflows/rust.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,8 @@ jobs:
1818
- uses: actions/checkout@v6
1919
- uses: taiki-e/install-action@v2
2020
with:
21-
tool: cargo-hack
22-
- run: >-
23-
cargo hack check --rust-version --workspace --all-targets
24-
--ignore-private
25-
working-directory: common
21+
tool: just,cargo-hack
22+
- run: just check-msrv
2623

2724
semver-checks:
2825
runs-on: macos-15
@@ -46,9 +43,11 @@ jobs:
4643
steps:
4744
- name: Checkout
4845
uses: actions/checkout@v6
46+
- uses: taiki-e/install-action@v2
47+
with:
48+
tool: just
4949
- name: rustfmt checks
50-
run: cargo fmt --check
51-
working-directory: common
50+
run: just format-common --check
5251

5352
build:
5453
runs-on: macos-15
@@ -57,11 +56,10 @@ jobs:
5756
cancel-in-progress: true
5857
steps:
5958
- uses: actions/checkout@v6
60-
- uses: taiki-e/install-action@nextest
61-
59+
- uses: taiki-e/install-action@v2
60+
with:
61+
tool: just,nextest
6262
- name: Cargo Build
63-
run: cargo build --verbose
64-
working-directory: common
65-
- name: Run tests
66-
run: cargo nextest run --no-fail-fast
67-
working-directory: common
63+
run: just build-common --verbose
64+
- name: Run tests (nextest + doctests)
65+
run: just test-common

.github/workflows/wasm-js.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,26 @@ jobs:
2020
- name: Install wasm-pack
2121
run: cargo install wasm-pack
2222

23+
- uses: taiki-e/install-action@v2
24+
with:
25+
tool: just
26+
2327
- uses: actions/setup-node@v4
2428
with:
2529
node-version: lts/*
26-
27-
- run: npm ci
28-
working-directory: web
29-
30-
- run: npm run format:check
31-
working-directory: web
3230

33-
- run: npm run lint
31+
- name: npm ci
32+
run: npm ci
3433
working-directory: web
3534

36-
- run: npm run build
37-
working-directory: web
35+
- name: Format + lint check
36+
run: just format-web --check
37+
38+
- name: Build web library
39+
run: just build-web
3840

39-
- run: npm run build:site
41+
- name: Build site
42+
run: npm run build:site
4043
working-directory: web
4144

4245
- name: WASM unit tests

0 commit comments

Comments
 (0)