cargo update #16
Workflow file for this run
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: CI | |
on: | |
pull_request: | |
push: | |
jobs: | |
test: | |
name: ${{ matrix.platform.os_name }} | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: | |
- os_name: Web Assembly w/ WebGPU | |
# So we can test on Safari. | |
os: macos-13 | |
target: wasm32-unknown-unknown | |
rustflags: --cfg=web_sys_unstable_apis | |
run_tests: false | |
- os_name: Web Assembly w/ WebGL2 | |
os: macos-13 | |
target: wasm32-unknown-unknown | |
run_tests: false | |
- os_name: Android ARMv8-A | |
os: ubuntu-22.04 | |
target: aarch64-linux-android | |
run_tests: true | |
- os_name: iOS A7+ | |
os: macos-13 | |
target: aarch64-apple-ios | |
# iOS needs a custom test runner. | |
run_tests: false | |
- os_name: Android x86_64 | |
os: ubuntu-22.04 | |
target: x86_64-linux-android | |
run_tests: true | |
- os_name: macOS Apple Silicon | |
os: macos-13 | |
target: aarch64-apple-darwin | |
# GitHub Actions' free/open-source tier does not support | |
# Apple Silicon yet. | |
run_tests: false | |
- os_name: macOS Intel | |
os: macos-13 | |
target: x86_64-apple-darwin | |
run_tests: true | |
- os_name: Windows ARMv8-A | |
os: windows-2022 | |
target: aarch64-pc-windows-msvc | |
# GitHub Actions' free/open-source tier does not support | |
# Windows on ARM yet. | |
run_tests: false | |
- os_name: Windows x86_64 | |
os: windows-2022 | |
target: x86_64-pc-windows-msvc | |
run_tests: true | |
- os_name: Linux ARMv8-A | |
os: ubuntu-22.04 | |
target: aarch64-unknown-linux-gnu | |
run_tests: true | |
- os_name: Linux ARMv7-A | |
os: ubuntu-22.04 | |
target: thumbv7neon-unknown-linux-gnueabihf | |
run_tests: true | |
- os_name: Linux x86_64/amd64 | |
os: ubuntu-22.04 | |
target: x86_64-unknown-linux-gnu | |
run_tests: true | |
toolchain: | |
- stable | |
runs-on: ${{ matrix.platform.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ matrix.platform.os_name }}-cargo-build-stable-${{ hashFiles('**/Cargo.toml') }} | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
components: rustfmt, clippy | |
targets: ${{ matrix.platform.target }} | |
- name: Install cross-rs | |
shell: bash | |
run: which cross && cross --version || cargo install cross --git https://github.com/cross-rs/cross --rev 3bfc6d54c817a2991f610d258f3290906c97474f --force | |
- name: Install wasm tools | |
if: ${{ matrix.platform.target == 'wasm32-unknown-unknown' }} | |
shell: bash | |
run: | | |
which wasm-bindgen && wasm-bindgen --version || cargo install wasm-bindgen-cli --version "0.2.87" --force | |
which wasm-pack && wasm-pack --version || cargo install wasm-pack --version "0.12.1" --force | |
- name: Install alsa and udev | |
if: runner.os == 'linux' | |
shell: bash | |
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev | |
- name: Build | |
shell: bash | |
run: RUSTFLAGS="${{ matrix.platform.rustflags }}" cross build --target ${{ matrix.platform.target }} | |
- name: Run native tests | |
if: ${{ matrix.platform.run_tests }} | |
shell: bash | |
run: RUSTFLAGS="${{ matrix.platform.rustflags }}" cross test --target ${{ matrix.platform.target }} | |
- name: Run web tests | |
if: ${{ matrix.platform.target == 'wasm32-unknown-unknown' }} | |
shell: bash | |
run: | | |
RUSTFLAGS="${{ matrix.platform.rustflags }}" wasm-pack test --node | |
RUSTFLAGS="${{ matrix.platform.rustflags }}" wasm-pack test --headless --chrome | |
RUSTFLAGS="${{ matrix.platform.rustflags }}" wasm-pack test --headless --firefox | |
RUSTFLAGS="${{ matrix.platform.rustflags }}" wasm-pack test --headless --safari | |
- name: Run clippy | |
shell: bash | |
run: RUSTFLAGS="${{ matrix.platform.rustflags }}" cross clippy --workspace --target ${{ matrix.platform.target }} --all-targets --all-features -- -D warnings | |
rustfmt: | |
name: Formatting | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ubuntu-22.04-cargo-build-stable-${{ hashFiles('**/Cargo.toml') }} | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
components: rustfmt | |
- name: Check format | |
shell: bash | |
run: cargo fmt --all -- --check |