Use sccache in CI #112
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Binaries | |
on: | |
push: | |
paths-ignore: | |
- 'dm/**' | |
- '.editorconfig' | |
- '.gitattributes' | |
- '.gitignore' | |
- '.rustfmt.toml' | |
- 'deny.toml' | |
pull_request: | |
paths-ignore: | |
- 'dm/**' | |
- '.editorconfig' | |
- '.gitattributes' | |
- '.gitignore' | |
- '.rustfmt.toml' | |
- 'deny.toml' | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build Releases | |
runs-on: ${{ matrix.os.runner }} | |
strategy: | |
matrix: | |
os: | |
- name: linux | |
runner: ubuntu-latest | |
target: i686-unknown-linux-gnu | |
- name: win | |
runner: windows-latest | |
target: i686-pc-windows-msvc | |
features: | |
- name: release | |
features: all | |
- name: release-debug | |
features: all,rel-debugging | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os.name }}-${{ matrix.features.name }} | |
cancel-in-progress: true | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Rust toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
target: ${{ matrix.os.target }} | |
- name: Install dependencies (Linux) | |
if: ${{ matrix.os.name == 'linux' }} | |
run: | | |
sudo dpkg --add-architecture i386 | |
sudo apt-get update | |
sudo apt-get install libgcc-s1:i386 g++-multilib zlib1g-dev:i386 libssl-dev:i386 | |
- name: Setup sccache | |
uses: mozilla-actions/[email protected] | |
- name: Build | |
run: cargo build --release --package aneri --target "${{ matrix.os.target }}" --no-default-features --features "${{ matrix.features.features }}" --locked | |
env: | |
PKG_CONFIG_ALLOW_CROSS: 1 | |
SCCACHE_GHA_ENABLED: "true" | |
RUSTC_WRAPPER: "sccache" | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: aneri-${{ matrix.os.name }}-${{ matrix.features.name }} | |
if-no-files-found: error | |
path: | | |
target/${{ matrix.os.target }}/release/aneri.dll | |
target/${{ matrix.os.target }}/release/aneri.pdb | |
target/${{ matrix.os.target }}/release/libaneri.so | |
target/${{ matrix.os.target }}/release/libaneri.so.dwp |