Skip to content

Use compile_error macro to replace build script #13

Use compile_error macro to replace build script

Use compile_error macro to replace build script #13

Workflow file for this run

name: Cross Compile
on:
# Trigger when merged on main
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# Manual trigger
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
build_x86:
name: Build
strategy:
fail-fast: false
matrix:
include:
- from: ubuntu-latest
target: "aarch64-apple-darwin"
can_work_as_hybrid: false
- from: ubuntu-latest
target: "aarch64-unknown-linux-gnu"
can_work_as_hybrid: false
- from: ubuntu-latest
target: "aarch64-unknown-linux-musl"
can_work_as_hybrid: false
- from: ubuntu-latest
target: "i686-unknown-linux-gnu"
can_work_as_hybrid: false
- from: ubuntu-latest
target: "x86_64-pc-windows-msvc"
can_work_as_hybrid: true
- from: ubuntu-latest
target: "x86_64-unknown-linux-gnu"
can_work_as_hybrid: true
- from: macos-latest
target: "aarch64-apple-darwin"
can_work_as_hybrid: false
# - from: macos-latest
# target: "x86_64-unknown-linux-gnu"
# can_work_as_hybrid: true
runs-on: ${{ matrix.from }}
steps:
- uses: actions/checkout@v3
- name: Install target
run: rustup target add ${{ matrix.target }}
- name: Build
run: cargo build --release --target ${{ matrix.target }}
- name: Switch to nightly rust
run: rustup default nightly
# if: ${{ matrix.can_work_as_hybrid }}
- name: Build Hybrid
continue-on-error: ${{ !matrix.can_work_as_hybrid }}
run: cargo build --release --features hybrid --target ${{ matrix.target }}