build: expand targets for x64/x86 compatibility #592
Workflow file for this run
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: CI | |
on: | |
push: | |
pull_request: | |
branches: | |
- master | |
jobs: | |
test: | |
name: Test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
build: [MSRV, stable, nightly, macos, win32, win64] | |
target: | |
- x86_64-unknown-linux-gnu # Linux x64 | |
- i686-unknown-linux-gnu # Linux x86 | |
- x86_64-apple-darwin # macOS x64 | |
- i686-pc-windows-msvc # Windows x86 | |
- x86_64-pc-windows-msvc # Windows x64 | |
include: | |
# Linux configurations | |
- build: MSRV # Minimum supported Rust version | |
rust: 1.63.0 | |
target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
- build: MSRV # Minimum supported Rust version | |
rust: 1.63.0 | |
target: i686-unknown-linux-gnu | |
os: ubuntu-latest | |
- build: stable | |
rust: stable | |
target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
- build: stable | |
rust: stable | |
target: i686-unknown-linux-gnu | |
os: ubuntu-latest | |
- build: nightly | |
rust: nightly | |
target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
- build: nightly | |
rust: nightly | |
target: i686-unknown-linux-gnu | |
os: ubuntu-latest | |
# macOS configuration | |
- build: macos | |
rust: stable | |
target: x86_64-apple-darwin | |
os: macos-latest | |
# Windows configurations | |
- build: win32 | |
rust: stable | |
target: i686-pc-windows-msvc | |
os: windows-latest | |
- build: win64 | |
rust: stable | |
target: x86_64-pc-windows-msvc | |
os: windows-latest | |
env: | |
CARGO_TARGET_DIR: ${{ github.workspace }}/target | |
steps: | |
- uses: actions/checkout@master | |
- name: Cache CARGO_HOME | |
uses: actions/cache@v1 | |
with: | |
path: ~/.cargo | |
key: ${{ runner.os }}-cargo-home-${{ hashFiles('**/Cargo.toml') }} | |
restore-keys: ${{ runner.os }}-cargo-home | |
- name: Install Rust | |
shell: bash | |
run: | | |
curl -sSL https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain=none | |
export PATH="$HOME/.cargo/bin:$PATH" | |
rustup override set ${{ matrix.rust }} | |
rustup target add ${{ matrix.target }} | |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
- name: rustfmt | |
shell: bash | |
if: runner.os == 'Linux' && matrix.rust == 'stable' | |
run: | | |
rustup component add rustfmt | |
cargo fmt -- --check | |
- run: cargo build --target ${{ matrix.target }} | |
- run: cargo build --all-targets --target ${{ matrix.target }} | |
# FIXME: Looks like fuzzer cannot be run on Windows | |
- if: runner.os == 'Linux' | |
run: cargo build --manifest-path=fuzz/Cargo.toml --target ${{ matrix.target }} | |
- run: cargo test --target ${{ matrix.target }} | |
- run: make api |