-
Notifications
You must be signed in to change notification settings - Fork 162
114 lines (109 loc) · 3.79 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: CI
on: [push, pull_request]
jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
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-2022
rust: stable
- build: mingw
os: windows-2022
rust: stable-x86_64-gnu
steps:
- uses: actions/checkout@v4
- 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 zlib --no-default-features
- run: cargo test --features zlib-default --no-default-features
- run: cargo test --features zlib-ng-compat --no-default-features
if: matrix.build != 'mingw'
- run: cargo test --features zlib-ng --no-default-features
if: matrix.build != 'mingw'
- run: cargo test --features zlib-rs --no-default-features
if: matrix.build != 'mingw'
- run: cargo test --features cloudflare_zlib --no-default-features
if: matrix.build != 'mingw'
- run: |
if ! cargo check --no-default-features 2>&1 | grep "You need to choose"; then
echo "expected message stating a zlib backend must be chosen"
exit 1
fi
if: matrix.build == 'stable'
rustfmt:
name: Rustfmt & Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: rustup update stable && rustup default stable && rustup component add rustfmt
- run: cargo fmt -- --check
- run: cargo doc --all-features
wasm:
name: WebAssembly
runs-on: ubuntu-latest
strategy:
matrix:
target: [wasm32-unknown-unknown, wasm32-wasi]
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: rustup update stable && rustup default stable && rustup target add ${{ matrix.target }}
- run: cargo build --target ${{ matrix.target }}
minimum:
name: Minimum Rust compiler
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2022, macos-latest, ubuntu-latest]
env:
version: 1.63.0
steps:
- uses: actions/checkout@v4
- name: Install Rust (rustup)
run: |
rustup toolchain install ${version} nightly --profile minimal --no-self-update
rustup default ${version}
cargo +nightly update -Zminimal-versions
shell: bash
- run: cargo build
- run: cargo build --features zlib
- run: cargo build --features zlib --no-default-features
- run: cargo build --features zlib-default --no-default-features
- run: cargo build --features zlib-ng-compat --no-default-features
- run: cargo build --features zlib-ng --no-default-features
- run: cargo build --features cloudflare_zlib --no-default-features
# Minimum Rust compiler to build `flate2` with no optional features
minimum-build:
name: Minimum Rust compiler
runs-on: ubuntu-latest
env:
# If this is changed to pass tests, then set `rust-version` in `Cargo.toml` to the same version.
version: 1.56.1
steps:
- uses: actions/checkout@v4
- name: Install Rust (rustup)
run: rustup update ${version} --no-self-update && rustup default ${version}
shell: bash
- run: cargo build