diff --git a/.github/workflows/patchable_pr.yaml b/.github/workflows/patchable_pr.yaml new file mode 100644 index 000000000..3fdd4f7af --- /dev/null +++ b/.github/workflows/patchable_pr.yaml @@ -0,0 +1,67 @@ +--- +name: Build patchable + +on: + pull_request: + paths: + - ".github/workflows/patchable_pr.yaml" + - "rust-toolchain.toml" + - "rust/patchable/**.rs" + - "Cargo.*" + +permissions: + contents: read + +env: + RUST_VERSION: 1.89.0 + +jobs: + # This job is always run to ensure we don't miss any new upstream advisories + cargo-deny: + name: Run cargo-deny + runs-on: ubuntu-latest + # Prevent sudden announcement of a new advisory from failing CI + continue-on-error: ${{ matrix.checks == 'advisories' }} + strategy: + matrix: + checks: + - advisories + - bans licenses sources + steps: + - name: Checkout Repository + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + persist-credentials: false + + - name: Run cargo-deny + uses: EmbarkStudios/cargo-deny-action@3fd3802e88374d3fe9159b834c7714ec57d6c979 # v2.0.15 + with: + command: check ${{ matrix.checks }} + + build: + name: Build patchable + needs: + - cargo-deny + strategy: + fail-fast: false + matrix: + targets: + - { target: aarch64-unknown-linux-gnu, os: ubuntu-24.04-arm } + - { target: x86_64-unknown-linux-gnu, os: ubuntu-latest } + - { target: aarch64-apple-darwin, os: macos-latest } + runs-on: ${{ matrix.targets.os }} + steps: + - name: Checkout + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + persist-credentials: false + + - uses: dtolnay/rust-toolchain@6d653acede28d24f02e3cd41383119e8b1b35921 + with: + toolchain: ${{ env.RUST_VERSION }} + targets: ${{ matrix.targets.target }} + + - name: Build Binary + env: + TARGET: ${{ matrix.targets.target }} + run: cargo build --target "$TARGET" --package patchable