ci #2082
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: | |
pull_request: | |
push: | |
branches: | |
- master | |
schedule: | |
- cron: '00 01 * * *' | |
jobs: | |
test: | |
name: test | |
runs-on: ${{ matrix.os }} | |
env: | |
CARGO: cargo | |
TARGET: | |
strategy: | |
matrix: | |
build: | |
- stable | |
- beta | |
- nightly | |
- macos | |
- win-msvc | |
- big-endian | |
- stable-32 | |
include: | |
- build: stable | |
os: ubuntu-latest | |
rust: stable | |
- build: beta | |
os: ubuntu-latest | |
rust: beta | |
- build: nightly | |
os: ubuntu-latest | |
rust: nightly | |
- build: macos | |
os: macos-latest | |
rust: stable | |
- build: win-msvc | |
os: windows-latest | |
rust: stable | |
- build: big-endian | |
os: ubuntu-latest | |
rust: stable | |
target: powerpc64-unknown-linux-gnu | |
- build: stable-32 | |
os: ubuntu-latest | |
rust: stable | |
target: i686-unknown-linux-gnu | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
- name: Use Cross | |
if: matrix.target != '' | |
run: | | |
cargo install cross | |
echo "CARGO=cross" >> $GITHUB_ENV | |
echo "TARGET=--target ${{ matrix.target }}" >> $GITHUB_ENV | |
- name: Build | |
run: ${{ env.CARGO }} build --all --verbose $TARGET | |
- name: Run default features tests | |
run: ${{ env.CARGO }} test --all --verbose $TARGET | |
- name: Run no-default-feature tests | |
run: ${{ env.CARGO }} test --no-default-features --all --verbose $TARGET | |
- name: Run json tests | |
run: ${{ env.CARGO }} test --features json --all --verbose $TARGET | |
- name: Compile benchmarks | |
if: matrix.build == 'stable' | |
run: cargo bench --verbose --no-run $TARGET | |
- name: Run miri | |
if: matrix.build == 'nightly' | |
run: | | |
rustup toolchain install nightly --component miri | |
cargo miri setup | |
cargo miri test | |
- name: Compile fuzz | |
if: matrix.build == 'nightly' | |
run: | | |
cargo install cargo-fuzz | |
RUSTFLAGS="--cfg unoptimized_build" cargo fuzz build fuzz_binary | |
cargo fuzz build fuzz_scalar_text | |
cargo fuzz build fuzz_text | |
cargo fuzz build fuzz_date |