mirror of
https://github.com/widberg/bff
synced 2026-08-23 14:26:03 -04:00
96 lines
2.7 KiB
YAML
96 lines
2.7 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "**"
|
|
tags-ignore:
|
|
- "*"
|
|
pull_request:
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
checks:
|
|
name: Checks
|
|
runs-on: ubuntu-latest
|
|
concurrency:
|
|
group: checks-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
steps:
|
|
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Configure Rust toolchain
|
|
run: |
|
|
rustup toolchain install nightly --profile minimal --component clippy --component rustfmt --no-self-update
|
|
|
|
- name: Rust Cache
|
|
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6
|
|
with:
|
|
save-if: ${{ github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
|
|
lookup-only: true
|
|
|
|
- name: Check formatting
|
|
run: cargo +nightly fmt --all -- --check
|
|
|
|
- name: Run Clippy
|
|
run: cargo +nightly clippy --locked --workspace --all-targets -- -D warnings
|
|
|
|
- name: Install cargo-deny
|
|
run: cargo +nightly install --locked cargo-deny
|
|
|
|
- name: Run cargo-deny
|
|
run: cargo +nightly deny check
|
|
|
|
- name: Install zizmor
|
|
run: cargo +nightly install --locked zizmor
|
|
|
|
- name: Run zizmor
|
|
run: zizmor --persona auditor --strict-collection .github/workflows
|
|
|
|
build:
|
|
name: Build for ${{ matrix.name }}
|
|
runs-on: ${{ matrix.os }}
|
|
needs: checks
|
|
concurrency:
|
|
group: build-${{ github.ref }}-${{ matrix.name }}
|
|
cancel-in-progress: true
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- name: linux
|
|
os: ubuntu-latest
|
|
- name: windows
|
|
os: windows-latest
|
|
bin_extension: .exe
|
|
- name: macos
|
|
os: macos-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Configure Rust toolchain
|
|
run: |
|
|
rustup toolchain install 1.88.0 --profile minimal --no-self-update
|
|
rustup default 1.88.0
|
|
|
|
- name: Rust Cache
|
|
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6
|
|
with:
|
|
save-if: ${{ github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
|
|
lookup-only: true
|
|
|
|
- name: Build
|
|
run: cargo build --release --locked -p bff-cli --bins
|
|
|
|
- name: Archive Artifacts
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
|
|
with:
|
|
name: bff-${{ matrix.name }}-${{ github.sha }}
|
|
path: |
|
|
./target/release/bff-cli${{ matrix.bin_extension }}
|