|
| 1 | +name: "Binaries (PR check)" |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +env: |
| 10 | + CARGO_INCREMENTAL: 0 |
| 11 | + CARGO_NET_GIT_FETCH_WITH_CLI: true |
| 12 | + CARGO_NET_RETRY: 10 |
| 13 | + CARGO_TERM_COLOR: always |
| 14 | + PKG_CONFIG_ALLOW_CROSS: 1 |
| 15 | + RUST_BACKTRACE: 1 |
| 16 | + RUSTFLAGS: -D warnings |
| 17 | + RUSTUP_MAX_RETRIES: 10 |
| 18 | + |
| 19 | +defaults: |
| 20 | + run: |
| 21 | + shell: bash |
| 22 | + |
| 23 | +jobs: |
| 24 | + build: |
| 25 | + name: ${{ matrix.target }} |
| 26 | + runs-on: ${{ matrix.os }} |
| 27 | + strategy: |
| 28 | + fail-fast: false |
| 29 | + matrix: |
| 30 | + include: |
| 31 | + - target: aarch64-unknown-linux-gnu |
| 32 | + os: ubuntu-24.04 |
| 33 | + use_cross: true |
| 34 | + features: vendored-openssl |
| 35 | + - target: aarch64-unknown-linux-musl |
| 36 | + os: ubuntu-24.04 |
| 37 | + use_cross: true |
| 38 | + features: vendored-openssl |
| 39 | + - target: aarch64-apple-darwin |
| 40 | + os: macos-15 |
| 41 | + use_cross: false |
| 42 | + features: vendored-openssl |
| 43 | + - target: aarch64-pc-windows-msvc |
| 44 | + os: windows-2022 |
| 45 | + use_cross: false |
| 46 | + features: "" |
| 47 | + - target: x86_64-unknown-linux-gnu |
| 48 | + os: ubuntu-24.04 |
| 49 | + use_cross: true |
| 50 | + features: vendored-openssl |
| 51 | + - target: x86_64-unknown-linux-musl |
| 52 | + os: ubuntu-24.04 |
| 53 | + use_cross: true |
| 54 | + features: vendored-openssl |
| 55 | + - target: x86_64-apple-darwin |
| 56 | + os: macos-15 |
| 57 | + use_cross: false |
| 58 | + features: vendored-openssl |
| 59 | + - target: x86_64-pc-windows-msvc |
| 60 | + os: windows-2022 |
| 61 | + use_cross: false |
| 62 | + features: "" |
| 63 | + timeout-minutes: 60 |
| 64 | + steps: |
| 65 | + - name: Checkout repository |
| 66 | + uses: actions/checkout@v6 |
| 67 | + - name: Install Linux build deps |
| 68 | + if: startsWith(matrix.os, 'ubuntu') |
| 69 | + run: | |
| 70 | + sudo apt-get update |
| 71 | + sudo apt-get install -y pkg-config libssl-dev ca-certificates |
| 72 | + - name: Install Rust toolchain |
| 73 | + uses: dtolnay/rust-toolchain@stable |
| 74 | + with: |
| 75 | + targets: ${{ matrix.target }} |
| 76 | + - name: Install cross |
| 77 | + if: matrix.use_cross == true |
| 78 | + uses: taiki-e/install-action@v2 |
| 79 | + with: |
| 80 | + tool: cross |
| 81 | + - run: echo "RUSTFLAGS=${RUSTFLAGS} -C target-feature=+crt-static" >> "${GITHUB_ENV}" |
| 82 | + if: endsWith(matrix.target, 'windows-msvc') |
| 83 | + - name: Build target |
| 84 | + run: | |
| 85 | + set -euo pipefail |
| 86 | + if [[ "${{ matrix.use_cross }}" == "true" ]]; then |
| 87 | + cross build --release --target "${{ matrix.target }}" ${EXTRA_FEATURES} |
| 88 | + else |
| 89 | + cargo build --release --target "${{ matrix.target }}" ${EXTRA_FEATURES} |
| 90 | + fi |
| 91 | + env: |
| 92 | + EXTRA_FEATURES: ${{ matrix.features && format('--features {0}', matrix.features) || '' }} |
0 commit comments