absolute paths

Change-Id: I277d078620a01f9fd4ccf7dba60a9b811c2fe424
Signed-off-by: Tom Proctor <tomhjp@users.noreply.github.com>
tomhjp/cigocacher-windows
Tom Proctor 6 days ago
parent 33c464d623
commit 9bb87e11ca
No known key found for this signature in database

@ -229,37 +229,43 @@ jobs:
- name: checkout - name: checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with: with:
path: src path: ${{ github.workspace }}/src
- name: Install Go - name: Install Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with: with:
go-version-file: src/go.mod go-version-file: ${{ github.workspace }}/src/go.mod
cache: false cache: false
- name: Restore Go module cache - name: Restore Go module cache
uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
with: with:
path: gomodcache path: ${{ github.workspace }}/gomodcache
key: ${{ needs.gomod-cache.outputs.cache-key }} key: ${{ needs.gomod-cache.outputs.cache-key }}
enableCrossOsArchive: true enableCrossOsArchive: true
- name: Setup cigocacher - name: Setup cigocacher
id: cigocacher-setup id: cigocacher-setup
uses: ./src/.github/actions/go-cache uses: ./src/.github/actions/go-cache
env:
GOMODCACHE: ${{ github.workspace }}/gomodcache
with: with:
checkout-path: src checkout-path: ${{ github.workspace }}/src
cache-dir: cigocacher cache-dir: ${{ github.workspace }}/cigocacher
cigocached-url: ${{ vars.CIGOCACHED_AZURE_URL }} cigocached-url: ${{ vars.CIGOCACHED_AZURE_URL }}
- name: test - name: test
if: matrix.key != 'win-bench' # skip on bench builder if: matrix.key != 'win-bench' # skip on bench builder
working-directory: src working-directory: src
env:
GOMODCACHE: ${{ github.workspace }}/gomodcache
run: go run ./cmd/testwrapper sharded:${{ matrix.shard }} run: go run ./cmd/testwrapper sharded:${{ matrix.shard }}
- name: bench all - name: bench all
if: matrix.key == 'win-bench' if: matrix.key == 'win-bench'
working-directory: src working-directory: src
env:
GOMODCACHE: ${{ github.workspace }}/gomodcache
# Don't use -bench=. -benchtime=1x. # Don't use -bench=. -benchtime=1x.
# Somewhere in the layers (powershell?) # Somewhere in the layers (powershell?)
# the equals signs cause great confusion. # the equals signs cause great confusion.

@ -20,7 +20,7 @@ func (dc *DiskCache) writeActionFile(b []byte, actionID string) (retErr error) {
defer func() { defer func() {
cerr := f.Close() cerr := f.Close()
if retErr != nil || cerr != nil { if retErr != nil || cerr != nil {
retErr = errors.Join(retErr, cerr) retErr = errors.Join(retErr, cerr, os.Remove(dest))
} }
}() }()
@ -77,7 +77,7 @@ func (dc *DiskCache) writeOutputFile(r io.Reader, size int64, outputID string) (
defer func() { defer func() {
cerr := f.Close() cerr := f.Close()
if retErr != nil || cerr != nil { if retErr != nil || cerr != nil {
retErr = errors.Join(retErr, cerr) retErr = errors.Join(retErr, cerr, os.Remove(dest))
} }
}() }()

Loading…
Cancel
Save