1name: CI 2on: [push, pull_request] 3 4jobs: 5 test: 6 name: Test 7 runs-on: ${{ matrix.os }} 8 strategy: 9 matrix: 10 # I don't really understand the build matrix here... 11 build: [stable, beta, nightly, macos, windows, mingw] 12 include: 13 - build: stable 14 os: ubuntu-latest 15 rust: stable 16 - build: beta 17 os: ubuntu-latest 18 rust: beta 19 - build: nightly 20 os: ubuntu-latest 21 rust: nightly 22 - build: macos 23 os: macos-latest 24 rust: stable 25 - build: windows 26 os: windows-2022 27 rust: stable 28 - build: mingw 29 os: windows-2022 30 rust: stable-x86_64-gnu 31 steps: 32 - uses: actions/checkout@v3 33 - name: Install Rust (rustup) 34 run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }} 35 shell: bash 36 - run: cargo build 37 - run: rustdoc --test README.md -L target/debug/deps --extern flate2=target/debug/libflate2.rlib --edition=2018 38 - run: cargo test 39 - run: cargo test --features zlib 40 - run: cargo test --features zlib --no-default-features 41 - run: cargo test --features zlib-default --no-default-features 42 - run: cargo test --features zlib-ng-compat --no-default-features 43 if: matrix.build != 'mingw' 44 - run: cargo test --features zlib-ng --no-default-features 45 if: matrix.build != 'mingw' 46 - run: cargo test --features cloudflare_zlib --no-default-features 47 if: matrix.build != 'mingw' 48 - run: | 49 if ! cargo check --no-default-features 2>&1 | grep "You need to choose"; then 50 echo "expected message stating a zlib backend must be chosen" 51 exit 1 52 fi 53 if: matrix.build == 'stable' 54 55 rustfmt: 56 name: Rustfmt 57 runs-on: ubuntu-latest 58 steps: 59 - uses: actions/checkout@v3 60 - name: Install Rust 61 run: rustup update stable && rustup default stable && rustup component add rustfmt 62 - run: cargo fmt -- --check 63 64 wasm: 65 name: WebAssembly 66 runs-on: ubuntu-latest 67 strategy: 68 matrix: 69 target: [wasm32-unknown-unknown, wasm32-wasi] 70 steps: 71 - uses: actions/checkout@v3 72 - name: Install Rust 73 run: rustup update stable && rustup default stable && rustup target add ${{ matrix.target }} 74 - run: cargo build --target ${{ matrix.target }} 75