|
| 1 | +on: |
| 2 | + push: |
| 3 | + branches: [master, staging, trying] |
| 4 | + tags: |
| 5 | + - "v*.*.*" |
| 6 | + |
| 7 | +name: Docker Build |
| 8 | + |
| 9 | +jobs: |
| 10 | + docker-build: |
| 11 | + needs: [docker-builds] |
| 12 | + runs-on: ${{ matrix.image }} |
| 13 | + steps: |
| 14 | + - name: Docker builds done |
| 15 | + run: exit 0 |
| 16 | + docker-builds: |
| 17 | + name: Docker Build |
| 18 | + runs-on: ${{ matrix.image }} |
| 19 | + env: |
| 20 | + CARGO_NET_RETRY: 3 |
| 21 | + CARGO_HTTP_CHECK_REVOKE: false |
| 22 | + strategy: |
| 23 | + fail-fast: false |
| 24 | + matrix: |
| 25 | + toolchain: [1.42.0] |
| 26 | + image: [ubuntu-latest] |
| 27 | + include: |
| 28 | + - target: aarch64-unknown-linux-gnu |
| 29 | + cpp: 1 |
| 30 | + dylib: 1 |
| 31 | + std: 1 |
| 32 | + run: 1 |
| 33 | + runners: qemu-user qemu-system |
| 34 | + - target: arm-unknown-linux-gnueabi |
| 35 | + cpp: 1 |
| 36 | + dylib: 1 |
| 37 | + std: 1 |
| 38 | + run: 1 |
| 39 | + - target: arm-unknown-linux-gnueabihf |
| 40 | + cpp: 1 |
| 41 | + dylib: 1 |
| 42 | + std: 1 |
| 43 | + run: 1 |
| 44 | + - target: armv7-unknown-linux-gnueabihf |
| 45 | + cpp: 1 |
| 46 | + dylib: 1 |
| 47 | + std: 1 |
| 48 | + run: 1 |
| 49 | + runners: qemu-user qemu-system |
| 50 | + - target: i586-unknown-linux-gnu |
| 51 | + cpp: 1 |
| 52 | + dylib: 1 |
| 53 | + std: 1 |
| 54 | + run: 1 |
| 55 | + - target: i686-unknown-linux-gnu |
| 56 | + cpp: 1 |
| 57 | + dylib: 1 |
| 58 | + std: 1 |
| 59 | + run: 1 |
| 60 | + runners: native qemu-user qemu-system |
| 61 | + - target: mips-unknown-linux-gnu |
| 62 | + cpp: 1 |
| 63 | + dylib: 1 |
| 64 | + std: 1 |
| 65 | + run: 1 |
| 66 | + runners: qemu-user qemu-system |
| 67 | + - target: mipsel-unknown-linux-gnu |
| 68 | + cpp: 1 |
| 69 | + dylib: 1 |
| 70 | + std: 1 |
| 71 | + run: 1 |
| 72 | + runners: qemu-user qemu-system |
| 73 | + - target: mips64-unknown-linux-gnuabi64 |
| 74 | + cpp: 1 |
| 75 | + dylib: 1 |
| 76 | + std: 1 |
| 77 | + run: 1 |
| 78 | + - target: mips64el-unknown-linux-gnuabi64 |
| 79 | + cpp: 1 |
| 80 | + dylib: 1 |
| 81 | + std: 1 |
| 82 | + run: 1 |
| 83 | + runners: qemu-user qemu-system |
| 84 | + - target: powerpc-unknown-linux-gnu |
| 85 | + cpp: 1 |
| 86 | + dylib: 1 |
| 87 | + std: 1 |
| 88 | + run: 1 |
| 89 | + runners: qemu-user qemu-system |
| 90 | + - target: powerpc64-unknown-linux-gnu |
| 91 | + cpp: 1 |
| 92 | + dylib: 1 |
| 93 | + std: 1 |
| 94 | + run: 1 |
| 95 | + runners: qemu-user qemu-system |
| 96 | + - target: powerpc64le-unknown-linux-gnu |
| 97 | + cpp: 1 |
| 98 | + dylib: 1 |
| 99 | + std: 1 |
| 100 | + run: 1 |
| 101 | + runners: qemu-user qemu-system |
| 102 | + - target: riscv64gc-unknown-linux-gnu |
| 103 | + cpp: 1 |
| 104 | + std: 1 |
| 105 | + run: 1 |
| 106 | + - target: s390x-unknown-linux-gnu |
| 107 | + cpp: 1 |
| 108 | + dylib: 1 |
| 109 | + std: 1 |
| 110 | + run: 1 |
| 111 | + runners: qemu-system |
| 112 | + - target: sparc64-unknown-linux-gnu |
| 113 | + cpp: 1 |
| 114 | + dylib: 1 |
| 115 | + std: 1 |
| 116 | + run: 1 |
| 117 | + runners: qemu-system |
| 118 | + - target: x86_64-unknown-linux-gnu |
| 119 | + cpp: 1 |
| 120 | + dylib: 1 |
| 121 | + std: 1 |
| 122 | + run: 1 |
| 123 | + runners: native qemu-user qemu-system |
| 124 | + deploy: 1 |
| 125 | + CRATES_IO_PUBLISH: 1 |
| 126 | + - target: aarch64-unknown-linux-musl |
| 127 | + std: 1 |
| 128 | + run: 1 |
| 129 | + - target: arm-unknown-linux-musleabihf |
| 130 | + std: 1 |
| 131 | + run: 1 |
| 132 | + - target: arm-unknown-linux-musleabi |
| 133 | + std: 1 |
| 134 | + run: 1 |
| 135 | + - target: armv5te-unknown-linux-gnueabi |
| 136 | + std: 1 |
| 137 | + run: 1 |
| 138 | + - target: armv5te-unknown-linux-musleabi |
| 139 | + std: 1 |
| 140 | + run: 1 |
| 141 | + - target: armv7-unknown-linux-musleabihf |
| 142 | + std: 1 |
| 143 | + run: 1 |
| 144 | + - target: i586-unknown-linux-musl |
| 145 | + std: 1 |
| 146 | + run: 1 |
| 147 | + - target: i686-unknown-linux-musl |
| 148 | + std: 1 |
| 149 | + run: 1 |
| 150 | + - target: mips-unknown-linux-musl |
| 151 | + cpp: 1 |
| 152 | + std: 1 |
| 153 | + run: 1 |
| 154 | + - target: mipsel-unknown-linux-musl |
| 155 | + cpp: 1 |
| 156 | + std: 1 |
| 157 | + run: 1 |
| 158 | + - target: x86_64-unknown-linux-musl |
| 159 | + std: 1 |
| 160 | + run: 1 |
| 161 | + deploy: 1 |
| 162 | + - target: aarch64-linux-android |
| 163 | + cpp: 1 |
| 164 | + std: 1 |
| 165 | + run: 1 |
| 166 | + - target: arm-linux-androideabi |
| 167 | + cpp: 1 |
| 168 | + std: 1 |
| 169 | + run: 1 |
| 170 | + - target: armv7-linux-androideabi |
| 171 | + cpp: 1 |
| 172 | + std: 1 |
| 173 | + run: 1 |
| 174 | + - target: i686-linux-android |
| 175 | + cpp: 1 |
| 176 | + std: 1 |
| 177 | + run: 1 |
| 178 | + - target: x86_64-linux-android |
| 179 | + cpp: 1 |
| 180 | + std: 1 |
| 181 | + run: 1 |
| 182 | + - target: x86_64-apple-darwin |
| 183 | + cpp: 1 |
| 184 | + dylib: 1 |
| 185 | + std: 1 |
| 186 | + run: 1 |
| 187 | + image: macOS-latest |
| 188 | + deploy: 1 |
| 189 | + - target: x86_64-pc-windows-gnu |
| 190 | + cpp: 1 |
| 191 | + std: 1 |
| 192 | + run: 1 |
| 193 | + - target: i686-pc-windows-gnu |
| 194 | + cpp: 1 |
| 195 | + std: 1 |
| 196 | + run: 1 |
| 197 | + - target: x86_64-unknown-dragonfly |
| 198 | + cpp: 1 |
| 199 | + dylib: 1 |
| 200 | + toolchain: nightly |
| 201 | + - target: i686-unknown-freebsd |
| 202 | + dylib: 1 |
| 203 | + std: 1 |
| 204 | + - target: x86_64-unknown-freebsd |
| 205 | + dylib: 1 |
| 206 | + std: 1 |
| 207 | + - target: x86_64-unknown-netbsd |
| 208 | + cpp: 1 |
| 209 | + dylib: 1 |
| 210 | + std: 1 |
| 211 | + - target: sparcv9-sun-solaris |
| 212 | + cpp: 1 |
| 213 | + dylib: 1 |
| 214 | + std: 1 |
| 215 | + - target: x86_64-sun-solaris |
| 216 | + cpp: 1 |
| 217 | + dylib: 1 |
| 218 | + std: 1 |
| 219 | + - target: asmjs-unknown-emscripten |
| 220 | + std: 1 |
| 221 | + run: 1 |
| 222 | + # `cargo run` fails with an assertion error (https://github.com/rust-lang/cargo/issues/4689) on `wasm32-unknown-emscripten`. |
| 223 | + - target: wasm32-unknown-emscripten |
| 224 | + std: 1 |
| 225 | + - target: thumbv6m-none-eabi |
| 226 | + std: 1 |
| 227 | + - target: thumbv7em-none-eabi |
| 228 | + std: 1 |
| 229 | + - target: thumbv7em-none-eabihf |
| 230 | + std: 1 |
| 231 | + - target: thumbv7m-none-eabi |
| 232 | + std: 1 |
| 233 | + - target: x86_64-pc-windows-msvc |
| 234 | + cpp: 1 |
| 235 | + std: 1 |
| 236 | + run: 1 |
| 237 | + image: vs2017-win2016 |
| 238 | + deploy: 1 |
| 239 | + |
| 240 | + steps: |
| 241 | + - uses: actions/checkout@v2 |
| 242 | + - name: install rust |
| 243 | + uses: actions-rs/toolchain@v1 |
| 244 | + with: |
| 245 | + toolchain: ${{ matrix.toolchain }} |
| 246 | + target: ${{ matrix.target }} |
| 247 | + default: true |
| 248 | + profile: minimal |
| 249 | + - run: echo "OS=${{ runner.os }}" >> $GITHUB_ENV |
| 250 | + - run: echo "BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV |
| 251 | + if: startsWith(github.ref, 'refs/heads/') |
| 252 | + - run: echo "TAG=${{ runner.os }}" >> $GITHUB_ENV |
| 253 | + if: startsWith(github.ref, 'refs/tags/') |
| 254 | + - name: Run unit tests |
| 255 | + uses: actions-rs/cargo@v1 |
| 256 | + with: |
| 257 | + command: test |
| 258 | + args: --locked |
| 259 | + timeout-minutes: 5 |
| 260 | + - name: Build Docker image |
| 261 | + if: runner.os == 'Linux' |
| 262 | + timeout-minutes: 360 |
| 263 | + env: |
| 264 | + TARGET: ${{ matrix.target }} |
| 265 | + CPP: ${{ matrix.cpp }} |
| 266 | + DYLIB: ${{ matrix.dylib }} |
| 267 | + STD: ${{ matrix.std }} |
| 268 | + RUN: ${{ matrix.run }} |
| 269 | + RUNNERS: ${{ matrix.runners }} |
| 270 | + run: ./build-docker-image.sh "${{ matrix.target }}" |
| 271 | + - name: Test |
| 272 | + run: ./ci/test.sh |
| 273 | + - name: Publish on crates.io |
| 274 | + if: startsWith(env.TAG, 'v') && matrix.CRATES_IO_PUBLISH == '1' |
| 275 | + env: |
| 276 | + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |
| 277 | + uses: actions-rs/cargo@v1 |
| 278 | + with: |
| 279 | + command: publish |
| 280 | + args: --dry-run |
| 281 | + - name: Create GitHub Release |
| 282 | + if: startsWith(env.TAG, 'v') && env.DEPLOY == '1' |
| 283 | + # TODO: Not sure what package to use for this step. |
| 284 | + run: echo "TODO"; exit 1 |
| 285 | + - name: Login to GHCR |
| 286 | + if: (env.BRANCH == 'master' || startsWith(env.TAG, 'v')) && runner.os == 'Linux' |
| 287 | + run: echo "${ secrets.GITHUB_TOKEN }" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin |
| 288 | + - name: Push image to GHCR |
| 289 | + if: (env.BRANCH == 'master' || startsWith(env.TAG, 'v')) && runner.os == 'Linux' |
| 290 | + run: ./ci/docker_push.sh |
0 commit comments