Skip to content

Commit a4369d5

Browse files
committed
test: simplify entire workflow
Coalesces setup lde step for android
1 parent 0931444 commit a4369d5

1 file changed

Lines changed: 9 additions & 23 deletions

File tree

.github/workflows/test.yml

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -28,57 +28,43 @@ jobs:
2828
submodules: recursive
2929

3030
- name: Setup lde
31-
if: "!matrix.android"
3231
uses: lde-org/setup-lde@master
3332
with:
3433
version: nightly
34+
platform: ${{ matrix.android && 'Android' || '' }}
3535

3636
- name: Run tests
3737
if: "!matrix.android"
3838
run: lde test
3939

40-
- name: Setup lde (Android)
41-
if: matrix.android
42-
uses: lde-org/setup-lde@master
43-
with:
44-
version: nightly
45-
platform: Android
46-
4740
- name: Fix workspace permissions (Android)
4841
if: matrix.android
4942
run: |
5043
chmod -R a+rw ${{ github.workspace }}
5144
cp ~/.lde/lde ${{ github.workspace }}/lde
5245
53-
- name: Cache Android test image
46+
- name: Cache test image (Android)
5447
if: matrix.android
5548
id: cache-android-image
5649
uses: actions/cache@v5
5750
with:
5851
path: /tmp/termux-android.tar
5952
key: termux-android-v6
6053

61-
- name: Setup Android test image
54+
- name: Run tests (Android)
6255
if: matrix.android
6356
run: |
64-
if [[ "${{ steps.cache-android-image.outputs.cache-hit }}" == "true" ]]; then
65-
docker load -i /tmp/termux-android.tar
66-
else
67-
docker rm -f termux-build 2>/dev/null || true
68-
docker run --privileged --platform linux/arm64 --name termux-build \
69-
-e DEBIAN_FRONTEND=noninteractive \
70-
termux/termux-docker:aarch64 \
57+
if [[ "${{ steps.cache-android-image.outputs.cache-hit }}" != "true" ]]; then
58+
docker run --rm --privileged --platform linux/arm64 \
59+
--name termux-build termux/termux-docker:aarch64 \
7160
bash -c "apt update && apt install -y clang cmake ninja openssl"
7261
docker commit termux-build termux-android:latest
73-
docker rm termux-build
7462
docker save termux-android:latest -o /tmp/termux-android.tar
7563
fi
7664
77-
- name: Run tests (Android)
78-
if: matrix.android
79-
run: |
80-
docker run --rm --privileged \
81-
--platform linux/arm64 \
65+
docker load -i /tmp/termux-android.tar
66+
67+
docker run --rm --privileged --platform linux/arm64 \
8268
-v ${{ github.workspace }}:/workspace \
8369
-w /workspace \
8470
termux-android:latest \

0 commit comments

Comments
 (0)