Skip to content

cicd: Enable cross compilation #24

cicd: Enable cross compilation

cicd: Enable cross compilation #24

Workflow file for this run

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:
job:
- { target: i686-unknown-linux-musl, os: linux, runner: ubuntu-latest, cross: true }
- { target: x86_64-unknown-linux-musl, os: linux, runner: ubuntu-latest, cross: false }
- { target: x86_64-apple-darwin, os: darwin, runner: macos-latest, cross: false }
- { target: x86_64-pc-windows-msvc, os: windows, runner: windows-latest, cross: false }
runs-on: ${{ matrix.job.runner }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Protoc
uses: arduino/setup-protoc@v3
if: not ${{ matrix.job.cross }}
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.job.target }}
toolchain: 1.76.0
components: rust-src,rust-docs,rustfmt,clippy
- name: Install cross-compilation tools
uses: taiki-e/setup-cross-toolchain-action@v1
with:
target: ${{ matrix.job.target }}
- name: Setup Cache
uses: Swatinem/[email protected]
with:
shared-key: "build-${{ matrix.job.target }}"
- name: Build
run: |
cargo build --locked --release
- name: Test
run: |
cargo test --locked --release
- name: Format
run: |
cargo fmt --check
- name: Clippy
run: |
cargo clippy --no-deps -- -Dwarnings -Dunused-crate-dependencies