Skip to content

Commit

Permalink
build: extract common steps; add cache to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
manhunto committed Nov 30, 2024
1 parent b2ccda4 commit aaffa75
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,32 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- <<: *common-steps
- name: Run build
run: cargo build --verbose

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- <<: *common-steps
- name: Run tests
run: cargo test --verbose

format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- <<: *common-steps
- name: Run format check
run: cargo fmt --check

clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run format check
run: cargo clippy
- <<: *common-steps
- name: Run clippy
run: cargo clippy

common-steps: &common-steps
- uses: actions/checkout@v3
- name: Cache setup
uses: Swatinem/rust-cache@v2

0 comments on commit aaffa75

Please sign in to comment.