Skip to content

Commit

Permalink
Add CI to test cross compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
ogxd committed May 17, 2024
1 parent d97a06b commit 0c4d243
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/cross_compile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Cross Compile

on:
workflow_dispatch:

env:
CARGO_TERM_COLOR: always

jobs:

build:
name: Build
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
include:
- target: "aarch64-apple-darwin"
can_work_as_hybrid: false
- target: "aarch64-unknown-linux-gnu"
can_work_as_hybrid: true
- target: "aarch64-unknown-linux-musl"
can_work_as_hybrid: true
- target: "i686-unknown-linux-gnu"
can_work_as_hybrid: true
- target: "x86_64-pc-windows-gnu"
can_work_as_hybrid: true

steps:
- uses: actions/checkout@v3

- name: Install target
run: rustup target add ${{ matrix.target }}

- name: Build
run: cargo build --release --target ${{ matrix.target }}

- name: Build Hybrid
if: ${{ matrix.can_work_as_hybrid }}
run: cargo build --release --features hybrid --target ${{ matrix.target }}
3 changes: 1 addition & 2 deletions .github/workflows/rust_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@ jobs:
run: rustup toolchain install ${{ matrix.version }}

- name: Build
# RUSTFLAGS="-C target-cpu=native --cfg hybrid"
run: RUSTFLAGS="-C target-cpu=native" cargo +${{ matrix.version }} build --release
run: cargo +${{ matrix.version }} build --release

0 comments on commit 0c4d243

Please sign in to comment.