• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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-latest
27            rust: stable
28          - build: mingw
29            os: windows-latest
30            rust: stable-x86_64-gnu
31    steps:
32    - uses: actions/checkout@master
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 miniz-sys
41    - run: cargo test --features zlib --no-default-features
42    - run: cargo test --features zlib-ng-compat --no-default-features
43    - run: cargo test --features cloudflare_zlib --no-default-features
44      if: matrix.build != 'mingw'
45    - run: cargo test --features miniz-sys --no-default-features
46    - run: cargo test --features tokio
47
48  rustfmt:
49    name: Rustfmt
50    runs-on: ubuntu-latest
51    steps:
52    - uses: actions/checkout@master
53    - name: Install Rust
54      run: rustup update stable && rustup default stable && rustup component add rustfmt
55    - run: cargo fmt -- --check
56
57  systest:
58    name: Systest
59    runs-on: ubuntu-latest
60    steps:
61    - uses: actions/checkout@master
62    - name: Install Rust
63      run: rustup update stable && rustup default stable
64    - run: cargo run --manifest-path systest/Cargo.toml
65
66  wasm:
67    name: WebAssembly
68    runs-on: ubuntu-latest
69    strategy:
70      matrix:
71        target: [wasm32-unknown-unknown, wasm32-wasi]
72    steps:
73    - uses: actions/checkout@master
74    - name: Install Rust
75      run: rustup update stable && rustup default stable && rustup target add ${{ matrix.target }}
76    - run: cargo build --target ${{ matrix.target }}
77
78  publish_docs:
79    name: Publish Documentation
80    runs-on: ubuntu-latest
81    steps:
82      - uses: actions/checkout@master
83      - name: Install Rust
84        run: rustup update stable && rustup default stable
85      - name: Build documentation
86        run: cargo doc --no-deps --all-features
87      - name: Publish documentation
88        run: |
89          cd target/doc
90          git init
91          git add .
92          git -c user.name='ci' -c user.email='ci' commit -m init
93          git push -f -q https://git:${{ secrets.github_token }}@github.com/${{ github.repository }} HEAD:gh-pages
94        if: github.event_name == 'push' && github.event.ref == 'refs/heads/master'
95