diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 19b3586..d07631c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,7 @@ permissions: # Use our Nix Flake Environment for steps defaults: run: - shell: nix develop --command bash {0} + shell: nix develop --command bash {0} on: pull_request: @@ -17,20 +17,14 @@ env: CARGO_TERM_COLOR: always jobs: - check: + formatting: if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.head_ref }} - - uses: cachix/install-nix-action@v22 - with: - nix_path: nixpkgs=channel:nixos-unstable + - uses: eneoli/flakeshot@v1 - name: Check formatting if: github.event.pull_request.head.repo.full_name != github.repository run: cargo fmt --check --verbose - - name: Format code id: format_code if: github.event.pull_request.head.repo.full_name == github.repository @@ -48,12 +42,26 @@ jobs: git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} git commit -am "Automated formatting" git push + check: + if: github.event.pull_request.draft == false + runs-on: ubuntu-latest + steps: + - uses: eneoli/flakeshot@v1 + - name: Check for build errors + run: cargo check --verbose + clippy: + if: github.event.pull_request.draft == false + runs-on: ubuntu-latest + steps: + - uses: eneoli/flakeshot@v1 - name: Check best practices (Clippy) run: cargo clippy --verbose -- -Dwarnings - - name: Check for build errors - run: cargo check --verbose - + tests: + if: github.event.pull_request.draft == false + runs-on: ubuntu-latest + steps: + - uses: eneoli/flakeshot@v1 - name: Running tests run: cargo test --verbose