feat(setup-repo): Use URI to generate target directory if not provided #2

Merged
noah.knegt merged 10 commits from optional-target-dir into main 2025-07-03 23:53:23 +02:00
8 changed files with 72 additions and 62 deletions
Showing only changes of commit 476f849ded - Show all commits

View File

@@ -7,18 +7,12 @@ env:
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
jobs: jobs:
cargo-check: cargo-fmt:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout source code - name: Checkout source code
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Setup rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt,clippy
# Cache cargo registry # Cache cargo registry
- name: Hash the lock file - name: Hash the lock file
uses: https://gitea.com/seepine/hash-files@v1 uses: https://gitea.com/seepine/hash-files@v1
@@ -26,24 +20,40 @@ jobs:
with: with:
patterns: | patterns: |
**/Cargo.lock **/Cargo.lock
- name: Cache cargo registry
uses: actions/cache@v3 - name: Setup rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with: with:
path: | toolchain: stable
~/.cargo/bin/ components: rustfmt,clippy
~/.cargo/registry/index/ cache-shared-key: cargo-${{ steps.get-hash.outputs.hash }}
~/.cargo/registry/cache/
~/.cargo/git/db/ - name: Rustfmt Check
target/ uses: actions-rust-lang/rustfmt@v1
key: cargo-${{ steps.get-hash.outputs.hash }}
restore-keys: | cargo-check:
cargo- runs-on: ubuntu-latest
# Cache cargo registry - end steps:
- name: Checkout source code
uses: actions/checkout@v4
# Cache cargo registry
- name: Hash the lock file
uses: https://gitea.com/seepine/hash-files@v1
id: get-hash
with:
patterns: |
**/Cargo.lock
- name: Setup rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
components: rustfmt,clippy
cache-shared-key: cargo-${{ steps.get-hash.outputs.hash }}
- name: Cargo check - name: Cargo check
uses: actions-rs/cargo@v1 run: cargo check --workspace
with:
command: check
clippy: clippy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -51,12 +61,6 @@ jobs:
- name: Checkout source code - name: Checkout source code
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Setup rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt,clippy
# Cache cargo registry # Cache cargo registry
- name: Hash the lock file - name: Hash the lock file
uses: https://gitea.com/seepine/hash-files@v1 uses: https://gitea.com/seepine/hash-files@v1
@@ -64,22 +68,13 @@ jobs:
with: with:
patterns: | patterns: |
**/Cargo.lock **/Cargo.lock
- name: Cache cargo registry
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: cargo-${{ steps.get-hash.outputs.hash }}
restore-keys: |
cargo-
# Cache cargo registry - end
- name: Run clippy - name: Setup rust
uses: actions-rs/clippy-check@v1 uses: actions-rust-lang/setup-rust-toolchain@v1
with: with:
token: ${{ secrets.GITHUB_TOKEN }} toolchain: stable
args: --all-targets --all-features -- -Dwarnings components: rustfmt,clippy
cache-shared-key: cargo-${{ steps.get-hash.outputs.hash }}
- name: Cargo check
run: cargo clippy --all-targets --all-features -- -Dwarnings