Skip to content

chore(CI): update CI workflows for new branching setup (#327) #989

chore(CI): update CI workflows for new branching setup (#327)

chore(CI): update CI workflows for new branching setup (#327) #989

Workflow file for this run

name: Continuous integration
on:
push:
branches:
- dev
- "release/**"
- "stable/**"
paths-ignore:
- "*.md"
- "LICENSE"
pull_request:
branches:
- dev
- "release/**"
- "stable/**"
paths-ignore:
- "*.md"
- "LICENSE"
env:
CARGO_TERM_COLOR: always
# sccache
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
jobs:
test:
runs-on:
- codebuild-defguard-gateway-runner-${{ github.run_id }}-${{ github.run_attempt }}
container: public.ecr.aws/docker/library/rust:1
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
submodules: recursive
- name: Scan code with Trivy
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
env:
TRIVY_SHOW_SUPPRESSED: 1
TRIVY_IGNOREFILE: "./.trivyignore.yaml"
with:
scan-type: 'fs'
scan-ref: '.'
exit-code: "1"
ignore-unfixed: true
severity: "CRITICAL,HIGH,MEDIUM"
scanners: "vuln"
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
- name: Install dependencies
run: apt-get update && apt-get -y install protobuf-compiler libnftnl-dev libmnl-dev
- name: Check format
run: |
rustup component add rustfmt
cargo fmt -- --check
- name: Run clippy linter
run: |
rustup component add clippy
cargo clippy --all-targets --all-features -- -D warnings
- name: Install cargo extensions
uses: taiki-e/install-action@3235f8901fd37ffed0052b276cec25a362fb82e9 # v2
with:
tool: cargo-deny
- name: Run cargo deny
run: cargo deny check
- name: Run tests
run: cargo test --locked --no-fail-fast