-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (75 loc) · 2.62 KB
/
test.yml
File metadata and controls
87 lines (75 loc) · 2.62 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
name: Test
on:
push:
pull_request:
jobs:
test:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
deps: sudo apt-get install -y cmake libssl-dev
- os: ubuntu-22.04-arm
deps: sudo apt-get install -y cmake libssl-dev
- os: ubuntu-22.04-arm
android: true
- os: windows-latest
- os: windows-11-arm
- os: macos-15
deps: brew install cmake
- os: macos-15-intel
deps: brew install cmake
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
if: matrix.deps
run: ${{ matrix.deps }}
- name: Setup cmake (Windows ARM64)
if: matrix.os == 'windows-11-arm'
uses: jwlawson/actions-setup-cmake@v2
- name: Setup lde
if: "!matrix.android"
uses: lde-org/setup-lde@master
with:
version: nightly
- name: Run tests
if: "!matrix.android"
run: lde test
- name: Fix workspace permissions (Android)
if: matrix.android
run: chmod -R a+rw ${{ github.workspace }}
- name: Cache Android test image
if: matrix.android
id: cache-android-image
uses: actions/cache@v5
with:
path: /tmp/termux-android.tar
key: termux-android-v5
- name: Setup Android test image
if: matrix.android
run: |
if [[ "${{ steps.cache-android-image.outputs.cache-hit }}" == "true" ]]; then
docker load -i /tmp/termux-android.tar
else
docker rm -f termux-build 2>/dev/null || true
docker run --privileged --platform linux/arm64 --name termux-build \
-e DEBIAN_FRONTEND=noninteractive \
termux/termux-docker:aarch64 \
bash -c "apt update && apt upgrade -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold && apt install -y git clang curl zip make cmake openssl && curl -fsSL https://lde.sh/install | sh -s -- --nightly"
docker commit termux-build termux-android:latest
docker rm termux-build
docker save termux-android:latest -o /tmp/termux-android.tar
fi
- name: Run tests (Android)
if: matrix.android
run: |
docker run --rm --privileged \
--platform linux/arm64 \
-v ${{ github.workspace }}:/workspace \
-w /workspace \
termux-android:latest \
bash -c "/data/data/com.termux/files/home/.lde/lde test"