Skip to content

Commit 64d7867

Browse files
committed
Set GITHUB_TOKEN when running tests (#1426)
1 parent 0f61344 commit 64d7867

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,8 @@ jobs:
321321
bun-version: ${{ env.BUN_VERSION }}
322322

323323
- name: "Cargo test"
324+
env:
325+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
324326
run: |
325327
cargo llvm-cov nextest \
326328
--no-report \
@@ -410,6 +412,8 @@ jobs:
410412
bun-version: ${{ env.BUN_VERSION }}
411413

412414
- name: "Cargo test"
415+
env:
416+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
413417
run: |
414418
cargo nextest run \
415419
--workspace \
@@ -570,6 +574,8 @@ jobs:
570574

571575
- name: "Cargo test"
572576
working-directory: ${{ env.PREK_WORKSPACE }}
577+
env:
578+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
573579
run: |
574580
# Remove msys64 from PATH for Rust compilation
575581
$env:PATH = ($env:PATH -split ';' | Where-Object { $_ -notmatch '\\msys64\\' }) -join ';'

crates/prek/tests/cache.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,29 @@ fn cache_gc_prunes_unused_tool_versions() -> anyhow::Result<()> {
373373
----- stderr -----
374374
");
375375

376+
cmd_snapshot!(context.filters(), context.command().args(["cache", "gc", "-v"]), @r"
377+
success: true
378+
exit_code: 0
379+
----- stdout -----
380+
Removed 2 hook envs, 3 tools ([SIZE])
381+
382+
Removed 2 hook envs:
383+
- ruby-remove
384+
path: [HOME]/hooks/ruby-remove
385+
- rust-remove
386+
path: [HOME]/hooks/rust-remove
387+
388+
Removed 3 tools:
389+
- go/1.23.0
390+
path: [HOME]/tools/go/1.23.0
391+
- node/21.0.0
392+
path: [HOME]/tools/node/21.0.0
393+
- python/3.11.0
394+
path: [HOME]/tools/python/3.11.0
395+
396+
----- stderr -----
397+
");
398+
376399
Ok(())
377400
}
378401

0 commit comments

Comments
 (0)