OnDemand Build Artifacts (iOS) #566
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: OnDemand Build Artifacts (iOS) | |
on: | |
workflow_dispatch: | |
inputs: | |
logLevel: | |
description: 'Log level' | |
required: true | |
default: 'warning' | |
type: choice | |
options: | |
- info | |
- warning | |
- debug | |
tags: | |
description: 'Test scenario tags' | |
required: false | |
type: boolean | |
schedule: | |
- cron: '0 16 * * *' | |
concurrency: | |
group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} | |
cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} | |
env: | |
CACHE_EPOCH: 131-1 | |
GOPROXY: direct | |
jobs: | |
ios-simulator-release: | |
runs-on: macos-15 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- arch: x64 | |
build_type: Release | |
rust_target: x86_64-apple-ios | |
- arch: arm64 | |
build_type: Release | |
rust_target: aarch64-apple-ios-sim | |
env: | |
BUILD_TYPE: '${{ matrix.build_type }}' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Checkout with shallow submodules | |
run: | | |
# unshallow must come first otherwise submodule may be get unshallowed | |
git fetch --tags --unshallow | |
git submodule update --init --depth 1 | |
- name: Cache tun2proxy build stage | |
id: tun2proxy-cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
third_party/tun2proxy/target/${{ matrix.rust_target }}/release/libtun2proxy.a | |
key: ${{ runner.os }}-rust-${{ matrix.rust_target }}-tun2proxy-${{ hashFiles('RUST_REVISION') }}-${{ hashFiles('RUST_CARGO_REVISION') }}-${{ hashFiles('third_party/tun2proxy/Cargo.toml') }}-v${{ env.CACHE_EPOCH }}-v1 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: '>=1.20.0' | |
cache-dependency-path: | | |
tools/go.sum | |
third_party/boringssl/src/go.sum | |
- name: Build build tool | |
run: | | |
cd tools | |
go build | |
- name: Build Binary (tun2proxy) | |
if: ${{ steps.tun2proxy-cache.outputs.cache-hit != 'true' }} | |
run: | | |
# required by m1 runner | |
# https://github.com/actions/runner-images/blob/main/images/macos/scripts/build/install-rust.sh | |
rm -rf $HOME/.cargo | |
# brew install rustup | |
rustup-init -y --no-modify-path --default-toolchain=stable --profile=minimal | |
source "$HOME/.cargo/env" | |
./scripts/setup-ios-rust.sh | |
WITH_OS=ios-sim WITH_CPU=${{ matrix.arch }} ./scripts/build-tun2proxy.sh | |
- name: Populate depedencies | |
run: | | |
# brew update | |
# brew install ninja cmake p7zip | |
brew install ninja | |
- name: Set up Xcode to 16.0 | |
run: | | |
sudo xcode-select -s /Applications/Xcode_16.0.app | |
- name: Build Binary and Run tests (arm64) | |
if: ${{ matrix.arch == 'arm64' }} | |
run: | | |
./tools/build --system ios --subsystem simulator --arch ${{ matrix.arch }} -run-test | |
- name: Build Binary and Skip tests (non-arm64) | |
if: ${{ matrix.arch != 'arm64' }} | |
run: | | |
./tools/build --system ios --subsystem simulator --arch ${{ matrix.arch }} -build-test -build-benchmark |