1name: test 2 3on: 4 push: 5 6env: 7 CARGO_TERM_COLOR: always 8 RUST_BACKTRACE: full 9 10jobs: 11 test: 12 name: Build & test 13 strategy: 14 fail-fast: false 15 matrix: 16 os: 17 - ubuntu-latest 18 - macos-latest 19 - windows-latest 20 rust: 21 - stable 22 - beta 23 - nightly 24 # Introduction of self: Arc<..>, needed for the iterator module 25 - 1.36.0 26 # Introduction of non_exhaustive, used at certain exfiltrators 27 - 1.40.0 28 29 runs-on: ${{ matrix.os }} 30 31 steps: 32 - name: checkout 33 uses: actions/checkout@v2 34 35 - name: Install Rust 36 uses: actions-rs/toolchain@v1 37 with: 38 toolchain: ${{ matrix.rust }} 39 default: true 40 profile: minimal 41 42 - name: Restore cache 43 uses: Swatinem/rust-cache@v1 44 45 - name: Build & test 46 env: 47 RUST_VERSION: ${{ matrix.rust }} 48 OS: ${{ matrix.os }} 49 run: ./ci-check.sh 50 51 rustfmt: 52 name: Check formatting 53 runs-on: ubuntu-latest 54 steps: 55 - name: checkout 56 uses: actions/checkout@v2 57 58 - name: Install Rust 59 uses: actions-rs/toolchain@v1 60 with: 61 profile: minimal 62 toolchain: stable 63 default: true 64 components: rustfmt 65 66 - run: cargo fmt --all -- --check 67 68 links: 69 name: Check documentation links 70 runs-on: ubuntu-latest 71 steps: 72 - name: checkout 73 uses: actions/checkout@v2 74 75 - name: Install Rust 76 uses: actions-rs/toolchain@v1 77 with: 78 toolchain: stable 79 default: true 80 81 - name: Restore cache 82 uses: Swatinem/rust-cache@v1 83 84 - name: Install cargo-deadlinks 85 uses: actions-rs/install@v0.1 86 with: 87 crate: cargo-deadlinks 88 use-tool-cache: true 89 90 - name: Check links 91 run: | 92 for package in $(cargo metadata --no-deps --format-version=1 | jq -r '.packages[] | .name'); do 93 cargo rustdoc -p "$package" --all-features -- -D warnings 94 dname=$(echo "$package" | tr '-' '_') 95 cargo deadlinks --dir "target/doc/$dname" --check-http --ignore-fragments 96 done 97 98 ancient-registry: 99 name: Check compilation of signal-hook-registry on 1.26.0 100 strategy: 101 matrix: 102 os: 103 - ubuntu-latest 104 - macos-latest 105 - windows-latest 106 runs-on: ${{ matrix.os }} 107 steps: 108 - name: checkout 109 uses: actions/checkout@v2 110 111 - name: Install Rust 112 uses: actions-rs/toolchain@v1 113 with: 114 toolchain: 1.26.0 115 default: true 116 profile: minimal 117 118 - name: Restore cache 119 uses: Swatinem/rust-cache@v1 120 121 - name: Check compilation 122 run: | 123 rm Cargo.toml 124 cd signal-hook-registry 125 sed -i -e '/signal-hook =/d' Cargo.toml 126 cargo check 127 128 ancient: 129 name: Check compilation on 1.31.0 130 strategy: 131 matrix: 132 os: 133 - ubuntu-latest 134 - macos-latest 135 - windows-latest 136 runs-on: ${{ matrix.os }} 137 steps: 138 - name: checkout 139 uses: actions/checkout@v2 140 141 - name: Install Rust 142 uses: actions-rs/toolchain@v1 143 with: 144 toolchain: 1.31.0 145 default: true 146 profile: minimal 147 148 - name: Restore cache 149 uses: Swatinem/rust-cache@v1 150 151 - name: Check compilation 152 run: | 153 rm Cargo.lock 154 cargo update 155 cargo check --no-default-features 156 157 158 clippy: 159 name: Clippy lints 160 runs-on: ubuntu-latest 161 steps: 162 - name: Checkout repository 163 uses: actions/checkout@v2 164 165 - name: Install Rust 166 uses: actions-rs/toolchain@v1 167 with: 168 toolchain: stable 169 profile: minimal 170 default: true 171 components: clippy 172 173 - name: Restore cache 174 uses: Swatinem/rust-cache@v1 175 176 - name: Run clippy linter 177 run: cargo clippy --all --all-features --tests -- -D clippy::all -D warnings 178 179 # There's bunch of platforms that have some weird quirks (or we don't know 180 # that they don't). While fully compiling and testing on them is a bit of a 181 # challenge, running cargo check on them should be easy enough and should 182 # catch at least some problems (like different sizes of types). 183 weird_platforms: 184 name: Check weird platforms 185 strategy: 186 fail-fast: false 187 matrix: 188 target: 189 - x86_64-unknown-linux-musl 190 - x86_64-pc-solaris 191 - x86_64-linux-android 192 - aarch64-linux-android 193 - arm-linux-androideabi 194 - mips-unknown-linux-musl 195 - x86_64-unknown-netbsd 196 - x86_64-unknown-freebsd 197 extra-args: 198 - "--all --all-features" 199 include: 200 # - wasm32-wasi (not yet? Or not ever?) 201 # - x86_64-unknown-redox (Is that platform even usable on stable?) 202 - { target: x86_64-fuchsia, extra-args: "--all-features" } 203 - { target: asmjs-unknown-emscripten, extra-args: "--all-features" } 204 # Seems we have some trouble with properly running C compiler on these. Might as well be problem with cross-compilation setup, but who knows 205 # So we avoid the exfiltrator part/signal-hook-sys :-( 206 - { target: x86_64-apple-darwin, extra-args: "--features=iterator --all --exclude signal-hook-sys" } 207 - { target: x86_64-apple-ios, extra-args: "--features=iterator --all --exclude signal-hook-sys" } 208 209 runs-on: ubuntu-latest 210 steps: 211 - name: checkout 212 uses: actions/checkout@v2 213 214 - name: Install Rust 215 uses: actions-rs/toolchain@v1 216 with: 217 toolchain: stable 218 profile: minimal 219 default: true 220 target: ${{ matrix.target }} 221 222 - name: Restore cache 223 uses: Swatinem/rust-cache@v1 224 225 - name: Run the check 226 uses: actions-rs/cargo@v1 227 with: 228 command: check 229 args: ${{ matrix.extra-args }} --tests --target=${{ matrix.target }} 230 use-cross: true 231