cicd: Enable cross compilation #27
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
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
name: Test | ||
jobs: | ||
dump-ctx: | ||
name: Context | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Dump Github context | ||
uses: crazy-max/ghaction-dump-context@v2 | ||
build-and-release: | ||
name: Build and Test | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
target: | ||
# BSDs | ||
- { platform: aarch64-unknown-freebsd, os: linux, runner: ubuntu-latest, run: true, nightly-only: true } # No rust core | ||
- { platform: i686-unknown-freebsd, os: linux, runner: ubuntu-latest, run: false, nightly-only: false } | ||
- { platform: x86_64-unknown-freebsd, os: linux, runner: ubuntu-latest, run: false, nightly-only: false } | ||
- { platform: aarch64-unknown-netbsd, os: linux, runner: ubuntu-latest, run: true, nightly-only: true } # No rust core | ||
- { platform: x86_64-unknown-netbsd, os: linux, runner: ubuntu-latest, run: false, nightly-only: false } | ||
# WASM | ||
#- { platform: wasm32-wasi, os: linux, runner: ubuntu-latest, run: true, nightly-only: false } # Incompatible Tokio | ||
# Android | ||
- { platform: aarch64-linux-android, os: linux, runner: ubuntu-latest, run: true, nightly-only: false } | ||
- { platform: arm-linux-androideabi, os: linux, runner: ubuntu-latest, run: true, nightly-only: false } | ||
- { platform: i686-linux-android, os: linux, runner: ubuntu-latest, run: true, nightly-only: false } | ||
- { platform: x86_64-linux-android, os: linux, runner: ubuntu-latest, run: true, nightly-only: false } | ||
# Linux Musl | ||
- { platform: aarch64-unknown-linux-musl, os: linux, runner: ubuntu-latest, run: true, nightly-only: false } | ||
- { platform: arm-unknown-linux-musleabi, os: linux, runner: ubuntu-latest, run: true, nightly-only: false } | ||
#- { platform: i586-unknown-linux-musl, os: linux, runner: ubuntu-latest, run: true, nightly-only: false } # Incompatible Ring: no SSE | ||
- { platform: i686-unknown-linux-musl, os: linux, runner: ubuntu-latest, run: true, nightly-only: false } | ||
- { platform: x86_64-unknown-linux-musl, os: linux, runner: ubuntu-latest, run: true, nightly-only: false } | ||
# Linux GNU | ||
- { platform: aarch64-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true, nightly-only: false } | ||
- { platform: arm-unknown-linux-gnueabi, os: linux, runner: ubuntu-latest, run: true, nightly-only: false } | ||
#- { platform: i586-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true, nightly-only: false } # Incompatible Ring: no SSE | ||
- { platform: i686-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true, nightly-only: false } | ||
- { platform: x86_64-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true, nightly-only: false } | ||
- { platform: mips-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true, nightly-only: true } # No rust core | ||
- { platform: mips64-unknown-linux-gnuabi64, os: linux, runner: ubuntu-latest, run: true, nightly-only: true } # No rust core | ||
- { platform: powerpc-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true, nightly-only: false } | ||
- { platform: powerpc64-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true, nightly-only: false } | ||
- { platform: riscv32gc-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true, nightly-only: true } # No rust core | ||
- { platform: riscv64gc-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true, nightly-only: false } | ||
- { platform: s390x-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true, nightly-only: false } | ||
- { platform: sparc-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true, nightly-only: false } | ||
#- { platform: sparc64-unknown-linux-gnu, os: linux, runner: ubuntu-latest, run: true, nightly-only: false } # Incompatible Ring: unknown Arch | ||
# MacOS | ||
- { platform: aarch64-apple-darwin, os: darwin, runner: macos-latest, run: false, nightly-only: false } | ||
- { platform: x86_64-apple-darwin, os: darwin, runner: macos-latest, run: true, nightly-only: false } | ||
# Windows | ||
- { platform: aarch64-pc-windows-msvc, os: windows, runner: windows-latest, run: true, nightly-only: false } | ||
#- { platform: i586-pc-windows-msvc, os: windows, runner: windows-latest, run: true, nightly-only: false } # Incompatible Ring: no SSE | ||
- { platform: i686-pc-windows-msvc, os: windows, runner: windows-latest, run: true, nightly-only: false } | ||
- { platform: x86_64-pc-windows-msvc, os: windows, runner: windows-latest, run: true, nightly-only: false } | ||
toolchain: | ||
#- 1.76.0 | ||
- nightly | ||
runs-on: ${{ matrix.target.runner }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
# - name: Install Protoc | ||
# uses: arduino/setup-protoc@v3 | ||
- uses: taiki-e/install-action@v2 | ||
with: | ||
Check failure on line 80 in .github/workflows/test.yml GitHub Actions / TestInvalid workflow file
|
||
tool: protoc,sccache | ||
- name: Install toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
#targets: ${{ matrix.target.platform }} | ||
toolchain: ${{ matrix.toolchain }} | ||
components: rust-src,rust-docs,rustfmt,clippy | ||
- name: Install cross-compilation tools | ||
uses: taiki-e/setup-cross-toolchain-action@v1 | ||
with: | ||
target: ${{ matrix.target.platform }} | ||
- name: Setup Cache | ||
uses: Swatinem/[email protected] | ||
with: | ||
shared-key: "build-${{ matrix.target.platform }}" | ||
- name: Build | ||
run: | | ||
cargo build -Zbuild-std --all --locked --release | ||
- name: Test | ||
if: ${{ matrix.target.run }} | ||
run: | | ||
cargo test -Zbuild-std --all --locked --release | ||
- name: Format | ||
run: | | ||
cargo fmt --all --check | ||
- name: Clippy | ||
run: | | ||
cargo clippy -Zbuild-std --all --no-deps -- -Dwarnings -Dunused-crate-dependencies |