name: CI
on:
push:
branches: ["feat", "main"]
env:
CARGO_TERM_COLOR: always
jobs:
RustChecks:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: install rust
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- name: build
run: cargo build --verbose --locked
- name: test
run: cargo test --verbose
- name: format
run: cargo fmt --check
- name: Run Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
NixBuild:
needs: RustChecks
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: install nix
uses: cachix/install-nix-action@75c75c31ebece974e48ebc36b4ad125bd97bd97b
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: run build
run: nix flake check
SonarQube:
if: github.ref == 'refs/heads/main'
needs: NixBuild
name: SonarQube
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 with:
fetch-depth: 0 - name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@7006c4492b2e0ee0f816d36501671557c97f5995 env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}