Skip to content

fix build error

fix build error #116

Workflow file for this run

name: Rust Build
on:
workflow_dispatch:
push:
branches: [master]
tags: ["v*"]
pull_request:
branches: [master]
permissions:
contents: write
pull-requests: read
jobs:
build:
name: Build
runs-on: ${{ matrix.config.runs-on }}
strategy:
fail-fast: false
matrix:
config:
- runs-on: macos-latest
target: aarch64-apple-darwin
test: true
cross: false
- runs-on: macos-latest
target: x86_64-apple-darwin
test: true
cross: false
- runs-on: ubuntu-latest
target: x86_64-unknown-linux-gnu
test: true
cross: false
- runs-on: ubuntu-latest
target: x86_64-unknown-linux-musl
test: true
cross: true
- runs-on: ubuntu-latest
target: aarch64-unknown-linux-gnu
test: false
cross: true
- runs-on: ubuntu-latest
target: armv7-unknown-linux-gnueabihf
test: false
cross: true
- runs-on: ubuntu-latest
target: aarch64-unknown-linux-musl
test: true
cross: true
- runs-on: windows-latest
target: x86_64-pc-windows-msvc
test: true
cross: false
- runs-on: windows-latest
target: i686-pc-windows-msvc
test: true
cross: false
- runs-on: ubuntu-latest
target: x86_64-pc-windows-gnu
test: false
cross: true
- runs-on: windows-latest
target: aarch64-pc-windows-msvc
test: false
cross: false
env:
CARGO_CMD: ${{ matrix.config.cross && 'cross' || 'cargo' }}
ARTIFACT_SUFFIX: ${{ contains(matrix.config.target, 'windows') && '.exe' || '' }}
TAG: ${{ github.ref_type == 'tag' && github.ref_name || github.sha }}
steps:
- name: Git config
if: runner.os == 'Windows'
run: git config --global core.autocrlf input
- uses: actions/checkout@v4
- name: Checkout submodule
run: git submodule update --init --recursive
- name: Install LLVM Windows
if: runner.os == 'Windows'
run: choco install llvm
- name: Setup LLVM path
if: runner.os == 'Windows'
run: |
echo "LIBCLANG_PATH=C:\Program Files\LLVM\bin" > $env:GITHUB_ENV
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ matrix.config.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install cross
if: matrix.config.cross
run: type cross > /dev/null || cargo install cross
- name: Install toolchain
run: rustup target install ${{ matrix.config.target }}
- name: Build
run: ${{ env.CARGO_CMD }} build --verbose --release --target ${{ matrix.config.target }}
- name: Test
if: matrix.config.test
run: ${{ env.CARGO_CMD }} test --verbose --release --target ${{ matrix.config.target }}