|
| 1 | +name: CI |
| 2 | +on: [push, pull_request] |
| 3 | + |
| 4 | +jobs: |
| 5 | + test: |
| 6 | + name: Test |
| 7 | + runs-on: ${{ matrix.os }} |
| 8 | + strategy: |
| 9 | + fail-fast: false |
| 10 | + matrix: |
| 11 | + thing: |
| 12 | + - stable |
| 13 | + - beta |
| 14 | + - nightly |
| 15 | + - macos-x86_64 |
| 16 | + - arm-android |
| 17 | + - arm64-android |
| 18 | + - i686-android |
| 19 | + - x86_64-android |
| 20 | + - i686-linux |
| 21 | + - arm-linux |
| 22 | + - aarch64-linux |
| 23 | + - x86_64-musl |
| 24 | + - x86_64-mingw |
| 25 | + - asmjs |
| 26 | + - i686-msvc |
| 27 | + - i686-msvc-static |
| 28 | + - x86_64-msvc |
| 29 | + - x86_64-msvc-static |
| 30 | + include: |
| 31 | + - thing: stable |
| 32 | + target: x86_64-unknown-linux-gnu |
| 33 | + rust: stable |
| 34 | + os: ubuntu-latest |
| 35 | + - thing: beta |
| 36 | + target: x86_64-unknown-linux-gnu |
| 37 | + rust: beta |
| 38 | + os: ubuntu-latest |
| 39 | + - thing: nightly |
| 40 | + target: x86_64-unknown-linux-gnu |
| 41 | + rust: nightly |
| 42 | + os: ubuntu-latest |
| 43 | + - thing: macos-x86_64 |
| 44 | + target: x86_64-apple-darwin |
| 45 | + rust: stable |
| 46 | + os: macos-latest |
| 47 | + - thing: arm-android |
| 48 | + target: arm-linux-androideabi |
| 49 | + rust: stable |
| 50 | + os: ubuntu-latest |
| 51 | + - thing: arm64-android |
| 52 | + target: aarch64-linux-android |
| 53 | + rust: stable |
| 54 | + os: ubuntu-latest |
| 55 | + - thing: i686-android |
| 56 | + target: i686-linux-android |
| 57 | + rust: stable |
| 58 | + os: ubuntu-latest |
| 59 | + - thing: x86_64-android |
| 60 | + target: x86_64-linux-android |
| 61 | + rust: stable |
| 62 | + os: ubuntu-latest |
| 63 | + - thing: i686-linux |
| 64 | + target: i686-unknown-linux-gnu |
| 65 | + rust: stable |
| 66 | + os: ubuntu-latest |
| 67 | + - thing: arm-linux |
| 68 | + target: arm-unknown-linux-gnueabi |
| 69 | + rust: stable |
| 70 | + os: ubuntu-latest |
| 71 | + - thing: aarch64-linux |
| 72 | + target: aarch64-unknown-linux-gnu |
| 73 | + rust: stable |
| 74 | + os: ubuntu-latest |
| 75 | + - thing: x86_64-musl |
| 76 | + target: x86_64-unknown-linux-musl |
| 77 | + rust: stable |
| 78 | + os: ubuntu-latest |
| 79 | + - thing: x86_64-mingw |
| 80 | + target: x86_64-pc-windows-gnu |
| 81 | + rust: stable |
| 82 | + os: ubuntu-latest |
| 83 | + - thing: asmjs |
| 84 | + target: asmjs-unknown-emscripten |
| 85 | + rust: stable |
| 86 | + os: ubuntu-latest |
| 87 | + - thing: i686-msvc |
| 88 | + target: i686-pc-windows-msvc |
| 89 | + rust: stable-i686-msvc |
| 90 | + os: windows-2016 |
| 91 | + - thing: i686-msvc-static |
| 92 | + target: i686-pc-windows-msvc |
| 93 | + rust: stable-i686-msvc |
| 94 | + os: windows-2016 |
| 95 | + crt_static: true |
| 96 | + - thing: x86_64-msvc |
| 97 | + target: x86_64-pc-windows-msvc |
| 98 | + rust: stable-x86_64-msvc |
| 99 | + os: windows-latest |
| 100 | + - thing: x86_64-msvc-static |
| 101 | + target: x86_64-pc-windows-msvc |
| 102 | + rust: stable-x86_64-msvc |
| 103 | + os: windows-latest |
| 104 | + crt_static: true |
| 105 | + |
| 106 | + steps: |
| 107 | + - uses: actions/checkout@master |
| 108 | + with: |
| 109 | + submodules: true |
| 110 | + - name: Install Rust (rustup) |
| 111 | + run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }} |
| 112 | + if: matrix.os != 'macos-latest' |
| 113 | + - name: Install Rust (macos) |
| 114 | + run: | |
| 115 | + curl https://sh.rustup.rs | sh -s -- -y |
| 116 | + echo "##[add-path]$HOME/.cargo/bin" |
| 117 | + if: matrix.os == 'macos-latest' |
| 118 | + - run: rustup target add ${{ matrix.target }} |
| 119 | + - name: Set crt-static |
| 120 | + if: matrix.crt_static == 'yes' |
| 121 | + run: echo "##[set-env name=RUSTFLAGS]-Ctarget-feature=+crt-static" |
| 122 | + shell: bash |
| 123 | + - name: Use strawberry perl |
| 124 | + if: startsWith(matrix.os, 'windows') |
| 125 | + run: echo "##[add-path]C:/Strawberry/perl/bin" |
| 126 | + shell: bash |
| 127 | + - run: | |
| 128 | + set -e |
| 129 | + cargo generate-lockfile |
| 130 | + ./ci/run-docker.sh ${{ matrix.target }} |
| 131 | + if: "!startsWith(matrix.os, 'windows')" |
| 132 | + name: Run tests (not Windows) |
| 133 | + - run: | |
| 134 | + set -e |
| 135 | + cargo test --manifest-path testcrate/Cargo.toml --target ${{ matrix.target }} |
| 136 | + cargo test --manifest-path testcrate/Cargo.toml --target ${{ matrix.target }} --release |
| 137 | + cargo run --release --target ${{ matrix.target }} --manifest-path testcrate/Cargo.toml --features package |
| 138 | + if: startsWith(matrix.os, 'windows') |
| 139 | + name: Run tests (Windows) |
| 140 | +
|
| 141 | + rustfmt: |
| 142 | + name: Rustfmt |
| 143 | + runs-on: ubuntu-latest |
| 144 | + steps: |
| 145 | + - uses: actions/checkout@master |
| 146 | + - name: Install Rust |
| 147 | + run: rustup update stable && rustup default stable && rustup component add rustfmt |
| 148 | + - run: cargo fmt -- --check |
0 commit comments