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

fix: xcode16 build #2429

Merged
merged 15 commits into from
Feb 20, 2025
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
17 changes: 17 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "Ubuntu Development",
"image": "ubuntu:22.04",

"customizations": {
"vscode": {
"extensions": [
"ms-vscode.rust-analyzer"
]
}
},

"features": {
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {}
}
}
20 changes: 20 additions & 0 deletions .github/actions/install-android-dep/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'Install Android Dependencies'
description: 'Sets up JDK and Android SDK/NDK'

runs:
using: "composite"
steps:
- name: Set up JDK environment
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 17

- name: Setup Android SDK
uses: android-actions/setup-android@v3
with:
cmdline-tools-version: 12266719

- name: Install NDK
shell: bash
run: echo "y" | ${ANDROID_SDK_ROOT}/cmdline-tools/16.0/bin/sdkmanager --install "ndk;24.0.8215888" --sdk_root=${ANDROID_SDK_ROOT}
38 changes: 18 additions & 20 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,9 @@ on:
jobs:
check:
name: Check on MacOS
runs-on: macos-13
runs-on: macos-15
steps:

- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1
with:
access_token: ${{ github.token }}

- name: Checkout sources
uses: actions/checkout@v4.1.1
with:
Expand All @@ -32,22 +27,25 @@ jobs:
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
bundler-cache: true
bundler-cache: false

- name: Setup - Xcode
run: sudo xcode-select -switch '/Applications/Xcode_15.0.app/Contents/Developer' && /usr/bin/xcodebuild -version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 16

- name: Install dependencies
run: |
brew install sourcery
bundle install

- name: Get cached Swift Packages managed by Xcode
uses: actions/cache@v3
with:
path: ~/Library/Developer/Xcode/DerivedData/**/SourcePackages/
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
# - name: Get cached Swift Packages managed by Xcode
# uses: actions/cache@v3
# with:
# path: ~/Library/Developer/Xcode/DerivedData/**/SourcePackages/
# key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
# restore-keys: |
# ${{ runner.os }}-spm-

- name: Install Rust targets
uses: dtolnay/rust-toolchain@stable
Expand All @@ -60,12 +58,12 @@ jobs:
with:
crate: uniffi_bindgen
version: 0.22.0 # Must be in sync with version in Cargo.toml
use-tool-cache: true
use-tool-cache: false

- name: Rust Cache
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
with:
workspaces: rust -> rust/target
# - name: Rust Cache
# uses: Swatinem/rust-cache@27b8ea9368cf428f0bfe41b0876b1a7e809d9844 # v2.7.7
# with:
# workspaces: rust -> rust/target

- name: Build iOS and run tests
shell: bash
Expand Down
101 changes: 42 additions & 59 deletions .github/workflows/android-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@ jobs:
build:
name: Build
runs-on: ubuntu-22.04
container:
image: ghcr.io/${{ github.repository }}/opencv-builder:4.11.0
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1
with:
access_token: ${{ github.token }}

- name: Checkout Sources
uses: actions/checkout@v4.1.1
Expand All @@ -30,7 +28,7 @@ jobs:
- name: Install System Dependencies (Linux)
run: |
sudo apt-get update
sudo apt-get install -y clang libclang-dev libopencv-dev
sudo apt-get install -y clang libclang-dev

- name: Install Rust stable toolchain
uses: dtolnay/rust-toolchain@stable
Expand All @@ -40,34 +38,28 @@ jobs:
with:
crate: uniffi_bindgen
version: 0.22.0 # Must be in sync with version in Cargo.toml
use-tool-cache: true
use-tool-cache: false

- name: Install additional rust targets
run: rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android

- name: Set up JDK environment
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 17

- name: Install NDK
run: echo "y" | sudo ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --install "ndk;24.0.8215888" --sdk_root=${ANDROID_SDK_ROOT}

- name: Rust Cache
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
with:
workspaces: rust -> rust/target

- name: Gradle Cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Install Android Dependencies
uses: ./.github/actions/install-android-dep

# - name: Rust Cache
# uses: Swatinem/rust-cache@27b8ea9368cf428f0bfe41b0876b1a7e809d9844 # v2.7.7
# with:
# workspaces: rust -> rust/target

# - name: Gradle Cache
# uses: actions/cache@v3
# with:
# path: |
# ~/.gradle/caches
# ~/.gradle/wrapper
# key: ${{ runner.os }}-gradle-${{ hashFiles('**/.gradle*', '**/gradle-wrapper.properties') }}
# restore-keys: |
# ${{ runner.os }}-gradle-

- name: Build
run: |
Expand All @@ -76,12 +68,10 @@ jobs:
makeapk:
name: Build unsigned APKs
runs-on: ubuntu-22.04
container:
image: ghcr.io/${{ github.repository }}/opencv-builder:4.11.0
# if: github.ref == ' refs/head/main'
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1
with:
access_token: ${{ github.token }}

- name: Checkout Sources
uses: actions/checkout@v4.1.1
Expand All @@ -90,10 +80,9 @@ jobs:
submodules: 'recursive'

- name: Install System Dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y clang libclang-dev libopencv-dev
sudo apt-get install -y clang libclang-dev

- name: Install Rust stable toolchain
uses: dtolnay/rust-toolchain@stable
Expand All @@ -103,41 +92,35 @@ jobs:
with:
crate: uniffi_bindgen
version: 0.22.0 # Must be in sync with version in Cargo.toml
use-tool-cache: true
use-tool-cache: false

- name: Install additional rust targets
run: rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android

- name: Set up JDK environment
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 17
- name: Install Android Dependencies
uses: ./.github/actions/install-android-dep

- name: Install NDK
run: echo "y" | sudo ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --install "ndk;24.0.8215888" --sdk_root=${ANDROID_SDK_ROOT}
# - name: Rust Cache
# uses: Swatinem/rust-cache@27b8ea9368cf428f0bfe41b0876b1a7e809d9844 # v2.7.7
# with:
# workspaces: rust -> rust/target

- name: Rust Cache
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
with:
workspaces: rust -> rust/target

- name: Gradle Cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
# - name: Gradle Cache
# uses: actions/cache@v3
# with:
# path: |
# ~/.gradle/caches
# ~/.gradle/wrapper
# key: ${{ runner.os }}-gradle-${{ hashFiles('**/.gradle*', '**/gradle-wrapper.properties') }}
# restore-keys: |
# ${{ runner.os }}-gradle-

- name: Assemble unsigned debug apk
run: |
./gradlew clean assembleDebug --stacktrace

- name: Upload Gplay unsigned APKs
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: signer-debug-unsigned
path: |
Expand Down
Loading