name: Unit and style tests permissions: actions: none checks: read contents: read deployments: none issues: none discussions: none packages: none pages: none pull-requests: read repository-projects: none security-events: none statuses: none concurrency: # don't run the test when there's is a newer version group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true on: push: branches: [ master ] paths: - "**.rs" pull_request: branches: [ master ] paths: - "**.rs" workflow_dispatch: jobs: unit-tests: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: Swatinem/rust-cache@v2 - uses: cachix/install-nix-action@v31 - uses: cachix/cachix-action@v16 with: name: devenv - name: Install devenv.sh run: nix profile add nixpkgs#devenv - name: Test dev build run: devenv shell cargo test - name: Test release build run: devenv shell cargo test --release style-checks: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: Swatinem/rust-cache@v2 - uses: cachix/install-nix-action@v31 - uses: cachix/cachix-action@v16 with: name: devenv - name: Install devenv.sh run: nix profile add nixpkgs#devenv - name: Clippy check run: devenv shell cargo clippy -- -D warnings - name: Format check run: devenv shell cargo fmt -- --check