|
| 1 | +name: Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: master |
| 6 | + pull_request: |
| 7 | + branches: master |
| 8 | + |
| 9 | +jobs: |
| 10 | + check-doc: |
| 11 | + name: Doc deadlinks |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v2 |
| 15 | + - name: Install toolchain |
| 16 | + uses: actions-rs/toolchain@v1 |
| 17 | + with: |
| 18 | + profile: minimal |
| 19 | + toolchain: nightly |
| 20 | + override: true |
| 21 | + - run: cargo install cargo-deadlinks |
| 22 | + - run: cargo deadlinks -- --features custom |
| 23 | + |
| 24 | + main-tests: |
| 25 | + name: Main tests |
| 26 | + runs-on: ${{ matrix.os }} |
| 27 | + strategy: |
| 28 | + matrix: |
| 29 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 30 | + toolchain: [nightly, beta, stable, 1.34] |
| 31 | + steps: |
| 32 | + - uses: actions/checkout@v2 |
| 33 | + - name: Install toolchain |
| 34 | + uses: actions-rs/toolchain@v1 |
| 35 | + with: |
| 36 | + profile: minimal |
| 37 | + toolchain: ${{ matrix.toolchain }} |
| 38 | + override: true |
| 39 | + - run: cargo test |
| 40 | + - run: cargo test --features std |
| 41 | + - if: ${{ matrix.toolchain == 'nightly' }} |
| 42 | + run: cargo build --benches |
| 43 | + |
| 44 | + linux-tests: |
| 45 | + name: Additional Linux targets |
| 46 | + runs-on: ubuntu-latest |
| 47 | + strategy: |
| 48 | + matrix: |
| 49 | + target: [ |
| 50 | + x86_64-unknown-linux-musl, |
| 51 | + i686-unknown-linux-gnu, |
| 52 | + i686-unknown-linux-musl, |
| 53 | + ] |
| 54 | + steps: |
| 55 | + - uses: actions/checkout@v2 |
| 56 | + - name: Install toolchain |
| 57 | + uses: actions-rs/toolchain@v1 |
| 58 | + with: |
| 59 | + profile: minimal |
| 60 | + target: ${{ matrix.target }} |
| 61 | + toolchain: stable |
| 62 | + override: true |
| 63 | + - run: sudo apt install gcc-multilib |
| 64 | + - run: cargo test --target ${{ matrix.target }} |
| 65 | + |
| 66 | + cross-tests: |
| 67 | + name: Cross tests |
| 68 | + runs-on: ${{ matrix.os }} |
| 69 | + strategy: |
| 70 | + matrix: |
| 71 | + include: |
| 72 | + - os: ubuntu-latest |
| 73 | + target: mips-unknown-linux-gnu |
| 74 | + toolchain: stable |
| 75 | + steps: |
| 76 | + - uses: actions/checkout@v2 |
| 77 | + - name: Install toolchain |
| 78 | + uses: actions-rs/toolchain@v1 |
| 79 | + with: |
| 80 | + profile: minimal |
| 81 | + target: ${{ matrix.target }} |
| 82 | + toolchain: ${{ matrix.toolchain }} |
| 83 | + override: true |
| 84 | + - name: Cache cargo plugins |
| 85 | + uses: actions/cache@v1 |
| 86 | + with: |
| 87 | + path: ~/.cargo/bin/ |
| 88 | + key: ${{ runner.os }}-cargo-plugins |
| 89 | + - name: Install cross |
| 90 | + run: cargo install cross || true |
| 91 | + - name: Test |
| 92 | + run: cross test --no-fail-fast --target ${{ matrix.target }} |
| 93 | + |
| 94 | + build: |
| 95 | + name: Build-only |
| 96 | + runs-on: ubuntu-latest |
| 97 | + strategy: |
| 98 | + matrix: |
| 99 | + target: [ |
| 100 | + x86_64-sun-solaris, |
| 101 | + x86_64-unknown-freebsd, |
| 102 | + x86_64-fuchsia, |
| 103 | + x86_64-unknown-netbsd, |
| 104 | + x86_64-unknown-redox, |
| 105 | + x86_64-fortanix-unknown-sgx, |
| 106 | + ] |
| 107 | + steps: |
| 108 | + - uses: actions/checkout@v2 |
| 109 | + - name: Install toolchain |
| 110 | + uses: actions-rs/toolchain@v1 |
| 111 | + with: |
| 112 | + profile: minimal |
| 113 | + target: ${{ matrix.target }} |
| 114 | + toolchain: nightly |
| 115 | + components: rust-src |
| 116 | + override: true |
| 117 | + - run: cargo build --target ${{ matrix.target }} |
| 118 | + |
| 119 | + build-rdrand: |
| 120 | + name: Build-only RDRAND |
| 121 | + runs-on: ubuntu-latest |
| 122 | + strategy: |
| 123 | + matrix: |
| 124 | + target: [ |
| 125 | + x86_64-unknown-cloudabi, |
| 126 | + x86_64-unknown-uefi, |
| 127 | + x86_64-unknown-hermit, |
| 128 | + x86_64-unknown-l4re-uclibc, |
| 129 | + x86_64-uwp-windows-gnu, |
| 130 | + x86_64-wrs-vxworks, |
| 131 | + ] |
| 132 | + steps: |
| 133 | + - uses: actions/checkout@v2 |
| 134 | + - name: Install toolchain |
| 135 | + uses: actions-rs/toolchain@v1 |
| 136 | + with: |
| 137 | + profile: minimal |
| 138 | + toolchain: nightly |
| 139 | + components: rust-src |
| 140 | + override: true |
| 141 | + - name: Cache cargo plugins |
| 142 | + uses: actions/cache@v1 |
| 143 | + with: |
| 144 | + path: ~/.cargo/bin/ |
| 145 | + key: ${{ runner.os }}-cargo-plugins |
| 146 | + - name: Install xbuild |
| 147 | + run: cargo install cargo-xbuild || true |
| 148 | + - name: Test |
| 149 | + run: cargo xbuild --features=rdrand --target ${{ matrix.target }} |
| 150 | + |
| 151 | + clippy-fmt: |
| 152 | + name: Clippy + rustfmt |
| 153 | + runs-on: ubuntu-latest |
| 154 | + steps: |
| 155 | + - uses: actions/checkout@v1 |
| 156 | + - uses: actions-rs/toolchain@v1 |
| 157 | + with: |
| 158 | + profile: minimal |
| 159 | + toolchain: stable |
| 160 | + components: rustfmt, clippy |
| 161 | + - name: clippy |
| 162 | + run: cargo clippy --all -- -D warnings |
| 163 | + - name: fmt |
| 164 | + run: cargo fmt --all -- --check |
0 commit comments