1+ name : android-build
2+
3+ permissions :
4+ contents : read
5+
6+ on :
7+ push :
8+ branches :
9+ - main
10+ pull_request :
11+ types :
12+ - opened
13+ - reopened
14+ - synchronize
15+
16+ concurrency :
17+ group : ' ${{ github.workflow }}-${{ github.head_ref || github.run_id }}'
18+ cancel-in-progress : true
19+
20+ jobs :
21+ build-android :
22+ name : ' build android ${{ matrix.arch }}'
23+ runs-on : ubuntu-24.04
24+ timeout-minutes : 90
25+ strategy :
26+ matrix :
27+ arch : [aarch64, x86_64]
28+ fail-fast : false
29+
30+ steps :
31+ - name : Configure git
32+ run : |
33+ git config --global core.symlinks true
34+ git config --global fetch.parallel 32
35+
36+ - name : Clone repository
37+ uses : actions/checkout@v4
38+ with :
39+ fetch-depth : 5
40+ submodules : false
41+
42+ - name : Clone submodule ./tests/util/std
43+ run : git submodule update --init --recursive --depth=1 -- ./tests/util/std
44+
45+ - name : Cache Cargo home
46+ uses : cirruslabs/cache@v4
47+ with :
48+ path : |
49+ ~/.cargo/.crates.toml
50+ ~/.cargo/.crates2.json
51+ ~/.cargo/bin
52+ ~/.cargo/registry/index
53+ ~/.cargo/registry/cache
54+ ~/.cargo/git/db
55+ key : ' cargo-home-android-${{ matrix.arch }}-${{ hashFiles('' Cargo.lock'' ) }}'
56+ restore-keys : ' cargo-home-android-${{ matrix.arch }}-'
57+
58+ - uses : dsherret/rust-toolchain-file@v1
59+
60+ - name : Install Android NDK
61+ uses : nttld/setup-ndk@v1
62+ with :
63+ ndk-version : r27c
64+
65+ - name : Add Android targets
66+ run : |
67+ rustup target add ${{ matrix.arch }}-linux-android
68+
69+ - name : Build for Android
70+ env :
71+ CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER : ${{ env.ANDROID_NDK_HOME }}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang
72+ CARGO_TARGET_X86_64_LINUX_ANDROID_LINKER : ${{ env.ANDROID_NDK_HOME }}/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android24-clang
73+ run : |
74+ cargo build --target ${{ matrix.arch }}-linux-android --locked
75+
76+ - name : Verify binary exists
77+ run : |
78+ ls -lh target/${{ matrix.arch }}-linux-android/debug/deno
0 commit comments