name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install zlib (Windows)
if: runner.os == 'Windows'
run: |
git clone https://github.com/Microsoft/vcpkg.git
.\vcpkg\bootstrap-vcpkg.bat
.\vcpkg\vcpkg.exe install zlib:x64-windows
.\vcpkg\vcpkg.exe integrate install
echo "VCPKG_ROOT=${{ github.workspace }}\vcpkg" >> $GITHUB_ENV
shell: cmd
- name: Set Rust/zlib environment variables
if: runner.os == 'Windows'
run: |
echo "ZLIB_LIB_DIR=${{ github.workspace }}\vcpkg\installed\x64-windows\lib" >> $GITHUB_ENV
echo "ZLIB_INCLUDE_DIR=${{ github.workspace }}\vcpkg\installed\x64-windows\include" >> $GITHUB_ENV
echo "LIBZ_SYS_STATIC=1" >> $GITHUB_ENV
shell: bash
- name: Build
run: cargo build --verbose --all-features
- name: Test (Linux)
if: runner.os == 'Linux'
run: cargo test --verbose --all-features