build(deps): bump anchore/scan-action from 7.0.1 to 7.0.2 (#898) #2777
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Bottlecap (Rust) | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
env: | |
PB_VERSION: 25.3 | |
PB_URL: https://github.com/protocolbuffers/protobuf/releases/download | |
PB_TARGET: linux-x86_64 | |
jobs: | |
cancel-previous: | |
name: Cancel Previous Jobs | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 3 | |
steps: | |
- uses: styfle/[email protected] | |
with: | |
access_token: ${{ secrets.GITHUB_TOKEN }} | |
all_but_latest: true # can cancel workflows scheduled later | |
check: | |
name: Check | |
runs-on: ubuntu-22.04 | |
env: | |
CARGO_INCREMENTAL: "0" | |
SCCACHE_GHA_ENABLED: "true" | |
RUSTC_WRAPPER: "sccache" | |
steps: | |
- uses: actions/checkout@v5 | |
# Install protobuf compiler for linux. The versions bundled with Ubuntu | |
# 20.04 and 22.04 are too old -- our messages require protobuf >= 3.15 -- | |
# so we need to download a protoc binary instead. | |
- run: sudo apt-get update | |
- run: sudo apt-get install -y curl unzip cmake | |
- name: Install protobuf ${{ env.PB_VERSION }} compiler from binary for ${{ env.PB_TARGET }} | |
run: | | |
curl -LO "${{ env.PB_URL }}/v${{ env.PB_VERSION }}/protoc-${{ env.PB_VERSION }}-${{ env.PB_TARGET }}.zip" | |
unzip "protoc-${{ env.PB_VERSION }}-${{ env.PB_TARGET }}.zip" -d "$HOME/.local" | |
export PATH="$PATH:$HOME/.local/bin" | |
- uses: actions-rust-lang/[email protected] | |
with: | |
cache: false | |
- uses: mozilla-actions/[email protected] | |
- working-directory: bottlecap | |
run: cargo check --workspace | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-22.04 | |
env: | |
CARGO_INCREMENTAL: "0" | |
SCCACHE_GHA_ENABLED: "true" | |
RUSTC_WRAPPER: "sccache" | |
steps: | |
- uses: actions/checkout@v5 | |
# Install protobuf compiler for linux. The versions bundled with Ubuntu | |
# 20.04 and 22.04 are too old -- our messages require protobuf >= 3.15 -- | |
# so we need to download a protoc binary instead. | |
- run: sudo apt-get update | |
- run: sudo apt-get install -y curl unzip cmake | |
- name: Install protobuf ${{ env.PB_VERSION }} compiler from binary for ${{ env.PB_TARGET }} | |
run: | | |
curl -LO "${{ env.PB_URL }}/v${{ env.PB_VERSION }}/protoc-${{ env.PB_VERSION }}-${{ env.PB_TARGET }}.zip" | |
unzip "protoc-${{ env.PB_VERSION }}-${{ env.PB_TARGET }}.zip" -d "$HOME/.local" | |
export PATH="$PATH:$HOME/.local/bin" | |
- uses: actions-rust-lang/[email protected] | |
with: | |
components: clippy | |
cache: false | |
- uses: mozilla-actions/[email protected] | |
# We need to do these separately because the fips feature is incompatible with the default feature. | |
- working-directory: bottlecap | |
run: cargo clippy --workspace --all-targets --features default | |
- working-directory: bottlecap | |
run: cargo clippy --workspace --all-targets --no-default-features --features fips | |
build-all: | |
name: Build All | |
runs-on: ubuntu-22.04 | |
env: | |
CARGO_INCREMENTAL: "0" | |
SCCACHE_GHA_ENABLED: "true" | |
RUSTC_WRAPPER: "sccache" | |
steps: | |
- uses: actions/checkout@v5 | |
# Install protobuf compiler for linux. The versions bundled with Ubuntu | |
# 20.04 and 22.04 are too old -- our messages require protobuf >= 3.15 -- | |
# so we need to download a protoc binary instead. | |
- run: sudo apt-get update | |
- run: sudo apt-get install -y curl unzip cmake | |
- name: Install protobuf ${{ env.PB_VERSION }} compiler from binary for ${{ env.PB_TARGET }} | |
run: | | |
curl -LO "${{ env.PB_URL }}/v${{ env.PB_VERSION }}/protoc-${{ env.PB_VERSION }}-${{ env.PB_TARGET }}.zip" | |
unzip "protoc-${{ env.PB_VERSION }}-${{ env.PB_TARGET }}.zip" -d "$HOME/.local" | |
export PATH="$PATH:$HOME/.local/bin" | |
- uses: actions-rust-lang/[email protected] | |
with: | |
cache: false | |
- uses: mozilla-actions/[email protected] | |
- working-directory: bottlecap | |
run: cargo build --all | |
test: | |
name: Test Suite | |
runs-on: ubuntu-22.04 | |
env: | |
CARGO_INCREMENTAL: "0" | |
SCCACHE_GHA_ENABLED: "true" | |
RUSTC_WRAPPER: "sccache" | |
steps: | |
- uses: actions/checkout@v5 | |
# Install protobuf compiler for linux. The versions bundled with Ubuntu | |
# 20.04 and 22.04 are too old -- our messages require protobuf >= 3.15 -- | |
# so we need to download a protoc binary instead. | |
- run: sudo apt-get update | |
- run: sudo apt-get install -y curl unzip cmake | |
- name: Install protobuf ${{ env.PB_VERSION }} compiler from binary for ${{ env.PB_TARGET }} | |
run: | | |
curl -LO "${{ env.PB_URL }}/v${{ env.PB_VERSION }}/protoc-${{ env.PB_VERSION }}-${{ env.PB_TARGET }}.zip" | |
unzip "protoc-${{ env.PB_VERSION }}-${{ env.PB_TARGET }}.zip" -d "$HOME/.local" | |
export PATH="$PATH:$HOME/.local/bin" | |
- uses: actions-rust-lang/[email protected] | |
with: | |
cache: false | |
- uses: taiki-e/install-action@v2 | |
with: | |
tool: [email protected] | |
- uses: mozilla-actions/[email protected] | |
- working-directory: bottlecap | |
run: cargo nextest run --workspace | |
format: | |
name: Format | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-22.04, macos-latest] | |
steps: | |
- uses: actions/checkout@v5 | |
- uses: actions-rust-lang/[email protected] | |
with: | |
components: rustfmt | |
cache: false | |
- working-directory: bottlecap | |
run: cargo fmt --all -- --check | |
# If this fails, run `dd-rust-license-tool write` in bottlecap/ | |
license-3rdparty: | |
runs-on: ubuntu-22.04 | |
name: "Valid LICENSE-3rdparty.csv" | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v5 | |
- run: cargo install dd-rust-license-tool --locked | |
- run: dd-rust-license-tool check | |
working-directory: bottlecap |