name: Cross on: workflow_call: inputs: ref: description: "Git ref to checkout" required: false type: string permissions: contents: read jobs: cross-linux: name: Cross - ${{ matrix.target }} runs-on: ubuntu-24.04 timeout-minutes: 45 env: CARGO_INCREMENTAL: 0 strategy: matrix: target: - x86_64-unknown-linux-gnu - x86_64-unknown-linux-musl - aarch64-unknown-linux-gnu - aarch64-unknown-linux-musl - armv7-unknown-linux-gnueabihf - armv7-unknown-linux-musleabihf - arm-unknown-linux-gnueabi - arm-unknown-linux-musleabi steps: - name: Checkout branch uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: ref: ${{ inputs.ref }} - uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 name: Cache Cargo registry + index with: path: | ~/.cargo/bin/ ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ runner.os }}-cargo- - run: echo "::add-matcher::.github/matchers/rust.json" - run: | rustup target add x86_64-unknown-linux-gnu cargo install cross --version 0.2.4 --force --locked # Why is this build, not check? Because we need to make sure the linking phase works. # aarch64 and musl in particular are notoriously hard to link. # While it may be tempting to slot a `check` in here for quickness, please don't. - run: make cross-build-${{ matrix.target }} - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: "vector-debug-${{ matrix.target }}" path: "./target/${{ matrix.target }}/debug/vector"