build: expand targets for x64/x86 compatibility #593
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 | |
strategy: | |
matrix: | |
build: [MSRV, stable, nightly, macos, win32, win64] | |
target: | |
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest } # Linux x64 | |
- { target: i686-unknown-linux-gnu, os: ubuntu-latest } # Linux x86 | |
- { target: x86_64-apple-darwin, os: macos-latest } # macOS x64 | |
- { target: i686-pc-windows-msvc, os: windows-latest } # Windows x86 | |
- { target: x86_64-pc-windows-msvc, os: windows-latest } # Windows x64 | |
include: | |
- build: MSRV # Minimum supported Rust version | |
rust: 1.63.0 | |
- build: stable | |
rust: stable | |
- build: nightly | |
rust: nightly | |
- build: macos | |
rust: stable | |
- build: win32 | |
rust: stable | |
- build: win64 | |
rust: stable | |
runs-on: ${{ matrix.target.os }} | |
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.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.target }} | |
- run: cargo build --all-targets --target ${{ matrix.target.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.target }} | |
- run: cargo test --target ${{ matrix.target.target }} | |
- run: make api |