|
| 1 | +name: Checks |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ "main" ] |
| 6 | + pull_request: |
| 7 | + branches: [ "main" ] |
| 8 | + |
| 9 | +env: |
| 10 | + CARGO_TERM_COLOR: always |
| 11 | + |
| 12 | +jobs: |
| 13 | + build: |
| 14 | + |
| 15 | + runs-on: ubuntu-latest |
| 16 | + |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v4 |
| 19 | + - name: Install Pipewire |
| 20 | + run: | |
| 21 | + sudo add-apt-repository ppa:pipewire-debian/pipewire-upstream |
| 22 | + sudo apt-get update |
| 23 | + sudo apt-get install pipewire pipewire-audio-client-libraries |
| 24 | + - name: Update to rust nightly |
| 25 | + run: rustup update nightly && rustup default nightly |
| 26 | + - name: Build |
| 27 | + run: cargo build --verbose |
| 28 | + - name: Run tests |
| 29 | + run: cargo test --verbose |
| 30 | + - name: Rustfmt |
| 31 | + run: | |
| 32 | + rustup component add rustfmt |
| 33 | + cargo fmt --all -- --check |
| 34 | + - name: Clippy |
| 35 | + run: | |
| 36 | + rustup component add clippy |
| 37 | + cargo clippy --all-features |
| 38 | + - name: Check Nix flake inputs |
| 39 | + uses: DeterminateSystems/flake-checker-action@v4 |
| 40 | + with: |
| 41 | + send-statistics: false |
| 42 | + - name: Install Lix |
| 43 | + uses: DeterminateSystems/nix-installer-action@v14 |
| 44 | + with: |
| 45 | + diagnostic-endpoint: '' |
| 46 | + source-url: https://install.lix.systems/lix/lix-installer-x86_64-linux |
| 47 | + logger: pretty |
| 48 | + - name: Nix Magic Cache |
| 49 | + uses: DeterminateSystems/magic-nix-cache-action@main |
| 50 | + with: |
| 51 | + diagnostic-endpoint: '' |
| 52 | + - name: Enter devshell |
| 53 | + run: nix develop |
| 54 | + - name: Check nix formatting |
| 55 | + run: git ls-files '*.nix' | xargs nix run nixpkgs#nixfmt-rfc-style -- --check ./ |
| 56 | + - name: Scan .nix files for dead code |
| 57 | + run: git ls-files '*.nix' | nix run nixpkgs#deadnix |
| 58 | + - name: Check for lints and suggestions |
| 59 | + run: nix run nixpkgs#statix -- check |
0 commit comments