6 Commits

Author SHA1 Message Date
cc4a8f3836 Update all non-major dependencies
Some checks failed
renovate/artifacts Artifact file update failure
Main workflow / Run lints & tests (push) Failing after 38s
2025-05-01 10:01:29 +00:00
7371bd2ea9 Update dtolnay/rust-toolchain digest to b3b07ba
All checks were successful
Main workflow / Run lints & tests (push) Successful in 1m8s
2025-05-01 09:44:29 +00:00
a4679d62cf Update dependency ubuntu to v24
All checks were successful
Main workflow / Run lints & tests (push) Successful in 1m9s
2025-05-01 01:01:50 +00:00
e6e658e014 Add github-actions to renovate
All checks were successful
Main workflow / Run lints & tests (push) Successful in 1m34s
2025-04-12 12:09:52 +02:00
8260f0db4c Upgrade CI
All checks were successful
Main workflow / Run lints & tests (push) Successful in 1m34s
2025-04-12 12:07:46 +02:00
85256bf559 Fix clippy lint 2025-04-12 11:52:01 +02:00
4 changed files with 63 additions and 59 deletions

View File

@@ -6,35 +6,33 @@ on:
jobs: jobs:
check: check:
name: Lint code & run tests name: Run lints & tests
runs-on: ubuntu-22.04 runs-on: ubuntu-24.04
container: alpine:3.21
timeout-minutes: 5 timeout-minutes: 5
steps: steps:
- name: Install dependencies
run: apk add cargo coreutils docker git nodejs rust-clippy rustfmt tar zstd
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Get Cargo.lock hash - name: Setup rust
id: hash uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b
run: | id: toolchain
hash="$(sha256sum Cargo.lock | awk '{print $1}')" with:
echo "hash=$hash" >>"$GITHUB_OUTPUT" toolchain: stable
targets: x86_64-unknown-linux-musl
components: clippy, rustfmt
- name: Setup cache - name: Setup cache
uses: actions/cache@v3 uses: actions/cache@v4
with: with:
path: | path: |
~/.cargo/bin/
~/.cargo/registry/index/ ~/.cargo/registry/index/
~/.cargo/registry/cache/ ~/.cargo/registry/cache/
~/.cargo/git/db/ ~/.cargo/git/db/
target/ target/
key: zpk-cargo-${{ steps.hash.outputs.hash }} key: cargo-${{ steps.toolchain.outputs.cachekey }}-${{ hashFiles('Cargo.lock') }}
restore-keys: | restore-keys: |
zpk-cargo- cargo-${{ steps.toolchain.outputs.cachekey }}-
cargo-
- name: Run fmt - name: Run fmt
run: cargo fmt --all --check run: cargo fmt --all --check
@@ -45,13 +43,19 @@ jobs:
- name: Run clippy - name: Run clippy
run: cargo clippy -- -D warnings run: cargo clippy -- -D warnings
- name: Download apk
run: |
wget -O apk https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic//v2.14.10/x86_64/apk.static
chmod +x apk
echo "$(pwd)" >>"$GITHUB_PATH"
- name: Run unit tests - name: Run unit tests
run: cargo test run: cargo test
- name: Build binary - name: Build binary
run: cargo build run: cargo build --target x86_64-unknown-linux-musl
- name: Start test container - name: Start integration test container
id: container id: container
run: | run: |
id="$(docker run --rm --privileged -d alpine:3.21 tail -f /dev/null)" id="$(docker run --rm --privileged -d alpine:3.21 tail -f /dev/null)"
@@ -60,17 +64,17 @@ jobs:
- name: Copy scripts - name: Copy scripts
run: | run: |
docker cp ./scripts/integration.sh "$ID":/tmp/ docker cp ./scripts/integration.sh "$ID":/tmp/
docker cp ./target/debug/zpk "$ID":/usr/bin/ docker cp ./target/x86_64-unknown-linux-musl/debug/zpk "$ID":/usr/bin/
env: env:
ID: ${{ steps.container.outputs.id }} ID: ${{ steps.container.outputs.id }}
- name: Run tests - name: Run integration tests
run: docker exec -i -u 0 "$ID" /tmp/integration.sh run: docker exec -i -u 0 "$ID" /tmp/integration.sh
env: env:
ID: ${{ steps.container.outputs.id }} ID: ${{ steps.container.outputs.id }}
- name: Stop test container - name: Stop integration test container
if: always() if: always()
run: docker stop "$ID" run: docker stop -t0 "$ID"
env: env:
ID: ${{ steps.container.outputs.id }} ID: ${{ steps.container.outputs.id }}

View File

@@ -5,6 +5,6 @@
"group:allNonMajor", "group:allNonMajor",
"schedule:monthly", "schedule:monthly",
], ],
"enabledManagers": ["cargo"], "enabledManagers": ["cargo", "github-actions"],
"osvVulnerabilityAlerts": true "osvVulnerabilityAlerts": true
} }

View File

@@ -11,10 +11,10 @@ cmd_lib = "1.9.3"
confy = "0.6.1" confy = "0.6.1"
ctrlc = "3.4.4" ctrlc = "3.4.4"
directories = "5.0.1" directories = "5.0.1"
dirs-sys = "0.4.1" dirs-sys = "0.5.0"
eyre = "0.6.12" eyre = "0.6.12"
nix = { version = "0.29.0", features = ["process", "signal", "user"] } nix = { version = "0.30.0", features = ["process", "signal", "user"] }
rand = "0.8.5" rand = "0.9.0"
serde = { version = "1.0.200", features = ["derive"] } serde = { version = "1.0.200", features = ["derive"] }
serde_json = "1.0.116" serde_json = "1.0.116"
spinoff = "0.8.0" spinoff = "0.8.0"

View File

@@ -18,7 +18,7 @@ fn get_repo_dir_from(path: &Path) -> eyre::Result<String> {
.lines() .lines()
.filter(|line| line.starts_with("REPODEST=")) .filter(|line| line.starts_with("REPODEST="))
.map(|line| line.trim_start_matches("REPODEST=")) .map(|line| line.trim_start_matches("REPODEST="))
.last(); .next_back();
let home_dir = dirs_sys::home_dir().unwrap(); let home_dir = dirs_sys::home_dir().unwrap();
let repo_dir = PathBuf::from(if let Some(repodest) = repodest { let repo_dir = PathBuf::from(if let Some(repodest) = repodest {
// This should probably be done with proper shell interpolation. // This should probably be done with proper shell interpolation.