Skip to content

macos-qa

macos-qa #39

Workflow file for this run

# Generated by mk-workflows.
name: 'macos-qa'
on:
push:
branches-ignore:
- release
pull_request:
branches-ignore:
- release
schedule:
- cron: '0 0 * * *'
concurrency:
group: 'macos-qa-${{ github.ref }}'
cancel-in-progress: true
jobs:
macos-qa-stable-all-features:
strategy:
fail-fast: false
matrix:
target: ["aarch64-apple-darwin", "x86_64-apple-darwin", "aarch64-apple-ios", "aarch64-apple-ios-sim", "x86_64-apple-ios"]
include:
- target: aarch64-apple-darwin
androidEnv: false
emscriptenEnv: false
runClippy: true
runTests: true
exampleArgs: '--driver cpu --driver pdf --driver svg'
generateArtifacts: true
features: 'gl,metal,svg,textlayout,ureq,vulkan,webp'
- target: x86_64-apple-darwin
androidEnv: false
emscriptenEnv: false
runClippy: false
runTests: false
exampleArgs: ''
generateArtifacts: false
features: 'gl,metal,svg,textlayout,ureq,vulkan,webp'
- target: aarch64-apple-ios
androidEnv: false
emscriptenEnv: false
runClippy: false
runTests: false
exampleArgs: ''
generateArtifacts: false
features: 'gl,metal,svg,textlayout,ureq,webp'
- target: aarch64-apple-ios-sim
androidEnv: false
emscriptenEnv: false
runClippy: false
runTests: false
exampleArgs: ''
generateArtifacts: false
features: 'gl,metal,svg,textlayout,ureq,webp'
- target: x86_64-apple-ios
androidEnv: false
emscriptenEnv: false
runClippy: false
runTests: false
exampleArgs: ''
generateArtifacts: false
features: 'gl,metal,svg,textlayout,ureq,webp'
runs-on: macos-14
env:
SKIA_DEBUG: 0
MACOSX_DEPLOYMENT_TARGET: '10.14'
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install Clippy
run: rustup component add clippy
- name: Install Ninja
run: brew install ninja
- name: 'Install Rust target ${{ matrix.target }}'
shell: bash
run: |
rustup target add ${{ matrix.target }}
- name: 'Build skia-safe for ${{ matrix.target }} with features "${{ matrix.features }}"'
shell: bash
run: |
if [ "${{ matrix.androidEnv }}" == "true" ]; then
TARGET=${{ matrix.target }}
TARGET=${TARGET//-/_}
export CC_${TARGET}=${{ matrix.target }}26-clang
export CXX_${TARGET}=${{ matrix.target }}26-clang++
export AR_${TARGET}=llvm-ar
TARGET_UPPERCASE=`echo "${TARGET}" | tr [a-z] [A-Z]`
export CARGO_TARGET_${TARGET_UPPERCASE}_LINKER=${{ matrix.target }}26-clang
echo "Set CC, CXX, and CARGO_LINKER target specific environment variables for Android"
fi
if [ "${{ matrix.emscriptenEnv }}" == "true" ]; then
source /emsdk/emsdk_env.sh
fi
cargo clean
cargo build -p skia-safe --release --features "${{ matrix.features }}" --target ${{ matrix.target }}
echo "SKIA_BINARIES_TAG=$(cat "${BUILD_ARTIFACTSTAGINGDIRECTORY}/skia-binaries/tag.txt")" >> ${GITHUB_ENV}
echo "SKIA_BINARIES_KEY=$(cat "${BUILD_ARTIFACTSTAGINGDIRECTORY}/skia-binaries/key.txt")" >> ${GITHUB_ENV}
echo "SKIA_STAGING_PATH=${BUILD_ARTIFACTSTAGINGDIRECTORY}" >> ${GITHUB_ENV}
env:
BUILD_ARTIFACTSTAGINGDIRECTORY: ${{ runner.temp }}
EMCC_CFLAGS: "-s ERROR_ON_UNDEFINED_SYMBOLS=0 -s MAX_WEBGL_VERSION=2"
- name: 'Run Clippy'
shell: bash
if: ${{ matrix.runClippy }}
run: |
cargo clippy --release --features "${{ matrix.features }}" --all-targets --target ${{ matrix.target }} -- -D warnings
- name: 'Test all workspace projects'
shell: bash
if: ${{ matrix.runTests }}
run: |
cargo test --all --release --features "${{ matrix.features }}" --all-targets --target ${{ matrix.target }} -- --nocapture
- name: 'Generate skia-org example images'
shell: bash
if: ${{ matrix.generateArtifacts }}
run: |
cargo run --release --features "${{ matrix.features }}" --target ${{ matrix.target }} "${{ env.SKIA_STAGING_PATH }}/skia-org" ${{ matrix.exampleArgs }}
- name: 'Upload skia-org example images'
if: ${{ matrix.generateArtifacts }}
uses: actions/upload-artifact@v4.6.0
with:
name: skia-org-images-${{ matrix.target }}
path: ${{ env.SKIA_STAGING_PATH }}/skia-org
- name: 'Compress binaries'
if: false
uses: a7ul/tar-action@v1.1.2
with:
command: c
cwd: '${{ env.SKIA_STAGING_PATH }}'
files: 'skia-binaries'
outPath: '${{ runner.temp }}/skia-binaries-${{ env.SKIA_BINARIES_KEY }}.tar.gz'
- name: 'Release binaries'
if: false
uses: pragmatrix/release-action@v1.11.1-rs
with:
owner: rust-skia
repo: skia-binaries
allowUpdates: true
replacesArtifacts: true
tag: '${{ env.SKIA_BINARIES_TAG }}'
artifacts: '${{ runner.temp }}/skia-binaries-${{ env.SKIA_BINARIES_KEY }}.tar.gz'
artifactErrorsFailBuild: true
token: ${{ secrets.RUST_SKIA_RELEASE_TOKEN }}
prerelease: true