Skip to content

Fix build

Fix build #7

Workflow file for this run

name: Rust
on:
push:
branches:
- main
tags:
- "*"
pull_request:
branches:
- main
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-20.04, target: x86_64-unknown-linux-gnu, platform: linux-x64, cross: general }
- { os: ubuntu-20.04, target: aarch64-unknown-linux-gnu, platform: linux-arm64, cross: aarch64 }
- { os: ubuntu-20.04, target: x86_64-unknown-linux-musl, platform: linux-musl, cross: musl }
- { os: ubuntu-20.04, target: x86_64-unknown-freebsd, platform: linux-bsd, cross: bsd }
- { os: macos-latest, target: x86_64-apple-darwin, platform: darwin-x64, cross: general }
- { os: macos-latest, target: aarch64-apple-darwin, platform: darwin-arm64, cross: general }
- { os: windows-latest, target: x86_64-pc-windows-msvc, platform: win32-x64, cross: general }
- { os: windows-latest, target: i686-pc-windows-msvc, platform: win32-ia32, cross: general }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Build - General
if: ${{ matrix.cross == 'general' }}
run: |
rustup target add ${{ matrix.target }}
cargo build --release --target ${{ matrix.target }} --target-dir target/${{ matrix.platform }}
- name: Build - musl
if: ${{ matrix.cross == 'musl' }}
run: |
cargo install cross
cross build --release --target ${{ matrix.target }} --target-dir target/${{ matrix.platform }}
- name: Build - aarch64
if: ${{ matrix.cross == 'aarch64' }}
env:
CC_aarch64_unknown_linux_gnu: aarch64-linux-gnu-gcc
CXX_aarch64_unknown_linux_gnu: aarch64-linux-gnu-g++
run: |
apt-get update
apt-get install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross g++-aarch64-linux-gnu
cargo build --release --target ${{ matrix.target }} --target-dir target/${{ matrix.platform }}