Skip to content

Commit

Permalink
update ci workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
TornaxO7 committed Feb 10, 2024
1 parent d04a603 commit 2c47df4
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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

0 comments on commit 2c47df4

Please sign in to comment.