Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

actions: avoid relying on included ndk, setup manually #420

Merged
merged 2 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ name: CD

env:
CACHE_SUFFIX: a
WGPU_ANDROID_NDK_VERSION: r27b # 27.1.12297006

on:
workflow_dispatch:
Expand Down Expand Up @@ -87,7 +88,7 @@ jobs:
target: i686-linux-android
setup_env: |
set -x
ANDROID_NDK_HOME=$ANDROID_HOME/ndk/27.0.12077973
ANDROID_NDK_HOME=$HOME/wgpu-deps/ndk/android-ndk-$WGPU_ANDROID_NDK_VERSION
CC=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android21-clang

echo "CC=$CC" >> $GITHUB_ENV
Expand All @@ -101,7 +102,7 @@ jobs:
target: x86_64-linux-android
setup_env: |
set -x
ANDROID_NDK_HOME=$ANDROID_HOME/ndk/27.0.12077973
ANDROID_NDK_HOME=$HOME/wgpu-deps/ndk/android-ndk-$WGPU_ANDROID_NDK_VERSION
CC=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android21-clang

echo "CC=$CC" >> $GITHUB_ENV
Expand All @@ -115,7 +116,7 @@ jobs:
target: aarch64-linux-android
setup_env: |
set -x
ANDROID_NDK_HOME=$ANDROID_HOME/ndk/27.0.12077973
ANDROID_NDK_HOME=$HOME/wgpu-deps/ndk/android-ndk-$WGPU_ANDROID_NDK_VERSION
CC=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang

echo "CC=$CC" >> $GITHUB_ENV
Expand All @@ -129,7 +130,7 @@ jobs:
target: armv7-linux-androideabi
setup_env: |
set -x
ANDROID_NDK_HOME=$ANDROID_HOME/ndk/27.0.12077973
ANDROID_NDK_HOME=$HOME/wgpu-deps/ndk/android-ndk-$WGPU_ANDROID_NDK_VERSION
CC=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi21-clang

echo "CC=$CC" >> $GITHUB_ENV
Expand Down Expand Up @@ -158,6 +159,13 @@ jobs:
uses: Swatinem/rust-cache@v2
with:
key: build-${{ matrix.TARGET }}-${{ matrix.CACHE_SUFFIX }}
- name: Setup Android NDK
run: |
mkdir -p $HOME/wgpu-deps/ndk
cd $HOME/wgpu-deps/ndk
curl -LO https://dl.google.com/android/repository/android-ndk-$WGPU_ANDROID_NDK_VERSION-linux.zip
unzip android-ndk-$WGPU_ANDROID_NDK_VERSION-linux.zip
rm android-ndk-$WGPU_ANDROID_NDK_VERSION-linux.zip
- name: Setup Environment
run: ${{ matrix.setup_env }}
- name: Build
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
CACHE_SUFFIX: a
WGPU_ANDROID_NDK_VERSION: r27b # 27.1.12297006

jobs:
# A build that does some "meta" checks on the code integrity where the Rust compiler can't.
Expand Down Expand Up @@ -83,7 +84,7 @@ jobs:
target: aarch64-linux-android
setup_env: |
set -x
ANDROID_NDK_HOME=$ANDROID_HOME/ndk/27.0.12077973
ANDROID_NDK_HOME=$HOME/wgpu-deps/ndk/android-ndk-$WGPU_ANDROID_NDK_VERSION
CC=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang

echo "CC=$CC" >> $GITHUB_ENV
Expand All @@ -98,7 +99,7 @@ jobs:
target: armv7-linux-androideabi
setup_env: |
set -x
ANDROID_NDK_HOME=$ANDROID_HOME/ndk/27.0.12077973
ANDROID_NDK_HOME=$HOME/wgpu-deps/ndk/android-ndk-$WGPU_ANDROID_NDK_VERSION
CC=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi21-clang

echo "CC=$CC" >> $GITHUB_ENV
Expand Down Expand Up @@ -126,6 +127,14 @@ jobs:
uses: Swatinem/rust-cache@v2
with:
key: clippy-${{ matrix.target }}-${{ env.CACHE_SUFFIX }}
- if: contains(matrix.target, 'android')
name: Setup Android NDK
run: |
mkdir -p $HOME/wgpu-deps/ndk
cd $HOME/wgpu-deps/ndk
curl -LO https://dl.google.com/android/repository/android-ndk-$WGPU_ANDROID_NDK_VERSION-linux.zip
unzip android-ndk-$WGPU_ANDROID_NDK_VERSION-linux.zip
rm android-ndk-$WGPU_ANDROID_NDK_VERSION-linux.zip
- name: Setup Environment
run: ${{ matrix.setup_env }}
- name: Run clippy
Expand Down
Loading