|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - 'v0.*' |
| 7 | + - staging |
| 8 | + - trying |
| 9 | + pull_request: |
| 10 | + branches: |
| 11 | + - master |
| 12 | + - 'v0.*' |
| 13 | + merge_group: |
| 14 | + |
| 15 | +env: |
| 16 | + RUST_BACKTRACE: 1 |
| 17 | + CARGO_TERM_COLOR: always |
| 18 | + CARGO_INCREMENTAL: 0 |
| 19 | + CARGO_NET_RETRY: 10 |
| 20 | + |
| 21 | +jobs: |
| 22 | + test: |
| 23 | + name: Test |
| 24 | + strategy: |
| 25 | + matrix: |
| 26 | + include: |
| 27 | + - rust: stable |
| 28 | + target: x86_64-unknown-linux-gnu |
| 29 | + os: ubuntu-20.04 |
| 30 | + - rust: stable |
| 31 | + target: x86_64-fortanix-unknown-sgx |
| 32 | + os: ubuntu-20.04 |
| 33 | + - rust: stable |
| 34 | + target: x86_64-pc-windows-msvc |
| 35 | + os: windows-latest |
| 36 | + - rust: stable |
| 37 | + target: x86_64-pc-windows-msvc |
| 38 | + os: windows-latest |
| 39 | + - rust: stable |
| 40 | + target: x86_64-pc-windows-msvc |
| 41 | + os: windows-2019 |
| 42 | + - rust: stable |
| 43 | + target: aarch64-unknown-linux-musl |
| 44 | + os: ubuntu-20.04 |
| 45 | + - rust: beta |
| 46 | + target: x86_64-unknown-linux-gnu |
| 47 | + os: ubuntu-20.04 |
| 48 | + - rust: nightly |
| 49 | + target: x86_64-unknown-linux-gnu |
| 50 | + os: ubuntu-20.04 |
| 51 | + |
| 52 | + runs-on: ${{ matrix.os }} |
| 53 | + |
| 54 | + steps: |
| 55 | + - uses: actions/checkout@v2 |
| 56 | + |
| 57 | + - name: Install qemu-user for aarch64 target |
| 58 | + if: matrix.target == 'aarch64-unknown-linux-musl' |
| 59 | + run: | |
| 60 | + sudo apt-get update |
| 61 | + sudo apt-get install -y qemu-user |
| 62 | +
|
| 63 | + - name: Install clang-11 on windows-2019 |
| 64 | + if: matrix.os == 'windows-2019' |
| 65 | + uses: KyleMayes/install-llvm-action@v1 |
| 66 | + with: |
| 67 | + version: "11.0" |
| 68 | + |
| 69 | + - name: Cache Dependencies |
| 70 | + uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894 |
| 71 | + with: |
| 72 | + key: ${{ matrix.rust }} |
| 73 | + |
| 74 | + - name: Setup Rust toolchain |
| 75 | + uses: actions-rs/toolchain@v1 |
| 76 | + with: |
| 77 | + toolchain: ${{ matrix.rust }} |
| 78 | + target: ${{ matrix.target }} |
| 79 | + override: true |
| 80 | + |
| 81 | + - name: Run tests |
| 82 | + run: | |
| 83 | + # Set LIBCLANG_PATH for bindgen to access clang library under windows-2019 |
| 84 | + if [ "$MATRIX_OS" == "windows-2019" ]; then |
| 85 | + export LIBCLANG_PATH="C:\Program Files\LLVM\bin" |
| 86 | + echo "$LIBCLANG_PATH" |
| 87 | + fi |
| 88 | + ./ci_tools.sh |
| 89 | + ./ci.sh |
| 90 | + env: |
| 91 | + TRAVIS_RUST_VERSION: ${{ matrix.rust }} |
| 92 | + TARGET: ${{ matrix.target }} |
| 93 | + MATRIX_OS: ${{ matrix.os }} |
| 94 | + ZLIB_INSTALLED: ${{ matrix.target == 'x86_64-unknown-linux-gnu' && 'true' || '' }} |
| 95 | + AES_NI_SUPPORT: ${{ matrix.target == 'x86_64-unknown-linux-gnu' && 'true' || '' }} |
| 96 | + shell: bash |
| 97 | + |
| 98 | + ci-success: |
| 99 | + name: ci |
| 100 | + if: always() |
| 101 | + needs: |
| 102 | + - test |
| 103 | + runs-on: ubuntu-20.04 |
| 104 | + steps: |
| 105 | + - run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}' |
| 106 | + - name: Done |
| 107 | + run: exit 0 |
0 commit comments