Skip to content

Commit

Permalink
Merge pull request #1877 from floccusaddon/fix-tests
Browse files Browse the repository at this point in the history
fix(ci): Use actions/cache v4
  • Loading branch information
marcelklehr authored Mar 5, 2025
2 parents 6ff0128 + b1a12a7 commit ca60d10
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
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

0 comments on commit ca60d10

Please sign in to comment.