95 lines
3.0 KiB
YAML
95 lines
3.0 KiB
YAML
name: CI
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
test:
|
|
name: Test
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
# I don't really understand the build matrix here...
|
|
build: [stable, beta, nightly, macos, windows, mingw]
|
|
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: windows
|
|
os: windows-latest
|
|
rust: stable
|
|
- build: mingw
|
|
os: windows-latest
|
|
rust: stable-x86_64-gnu
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- name: Install Rust (rustup)
|
|
run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }}
|
|
shell: bash
|
|
- run: cargo build
|
|
- run: rustdoc --test README.md -L target/debug/deps --extern flate2=target/debug/libflate2.rlib --edition=2018
|
|
- run: cargo test
|
|
- run: cargo test --features zlib
|
|
- run: cargo test --features miniz-sys
|
|
- run: cargo test --features zlib --no-default-features
|
|
- run: cargo test --features zlib-ng-compat --no-default-features
|
|
- run: cargo test --features cloudflare_zlib --no-default-features
|
|
if: matrix.build != 'mingw'
|
|
- run: cargo test --features miniz-sys --no-default-features
|
|
- run: cargo test --features tokio
|
|
|
|
rustfmt:
|
|
name: Rustfmt
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- name: Install Rust
|
|
run: rustup update stable && rustup default stable && rustup component add rustfmt
|
|
- run: cargo fmt -- --check
|
|
|
|
systest:
|
|
name: Systest
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- name: Install Rust
|
|
run: rustup update stable && rustup default stable
|
|
- run: cargo run --manifest-path systest/Cargo.toml
|
|
|
|
wasm:
|
|
name: WebAssembly
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
target: [wasm32-unknown-unknown, wasm32-wasi]
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- name: Install Rust
|
|
run: rustup update stable && rustup default stable && rustup target add ${{ matrix.target }}
|
|
- run: cargo build --target ${{ matrix.target }}
|
|
|
|
publish_docs:
|
|
name: Publish Documentation
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- name: Install Rust
|
|
run: rustup update stable && rustup default stable
|
|
- name: Build documentation
|
|
run: cargo doc --no-deps --all-features
|
|
- name: Publish documentation
|
|
run: |
|
|
cd target/doc
|
|
git init
|
|
git add .
|
|
git -c user.name='ci' -c user.email='ci' commit -m init
|
|
git push -f -q https://git:${{ secrets.github_token }}@github.com/${{ github.repository }} HEAD:gh-pages
|
|
if: github.event_name == 'push' && github.event.ref == 'refs/heads/master'
|