Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): Use actions/cache v4 #1877

Merged
merged 3 commits into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
run: npm i -g npm@"${{ matrix.npm-version }}"

- name: Cache node modules
uses: actions/cache@v1
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
Expand All @@ -49,7 +49,7 @@ jobs:
npm run build-release --if-present

- name: Save context
uses: buildjet/cache/save@v3
uses: actions/cache/save@v4
with:
key: build-context-${{ github.run_id }}
path: ./
Expand All @@ -68,7 +68,7 @@ jobs:
java-version: ${{ matrix.java-version }}

- name: Restore context
uses: buildjet/cache/restore@v3
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
key: build-context-${{ github.run_id }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
run: npm i -g npm@"${{ matrix.npm-version }}"

- name: Cache node modules
uses: actions/cache@v1
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
Expand All @@ -65,7 +65,7 @@ jobs:
npm run build-release --if-present

- name: Save context
uses: buildjet/cache/save@v3
uses: actions/cache/save@v4
with:
key: selenium-context-${{ github.run_id }}
path: ./
Expand Down Expand Up @@ -173,7 +173,7 @@ jobs:
steps:

- name: Restore context
uses: buildjet/cache/restore@v3
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
key: selenium-context-${{ github.run_id }}
Expand Down
9 changes: 5 additions & 4 deletions src/lib/adapters/Git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,12 @@ export default class GitAdapter extends CachingAdapter {
}
}

async clearAllLocks(): Promise<void> {
const tags = await git.listTags({ fs: this.fs, dir: this.dir })
async clearAllLocks(fs:FS = null): Promise<void> {
fs = fs || this.fs
const tags = await git.listTags({ fs, dir: this.dir })
const lockTags = tags.filter(tag => tag.startsWith('floccus-lock-'))
for (const tag of lockTags) {
await git.push({ fs: this.fs, http, dir: this.dir, ref: tag, delete: true, onAuth: () => this.onAuth() })
await git.push({ fs, http, dir: this.dir, ref: tag, delete: true, onAuth: () => this.onAuth() })
}
}

Expand Down Expand Up @@ -378,7 +379,7 @@ export default class GitAdapter extends CachingAdapter {
depth: 10,
onAuth: () => this.onAuth()
})
await this.clearAllLocks()
await this.clearAllLocks(fs)
}
}

Expand Down
Loading