Skip to content

Commit e1bd8bf

Browse files
committed
chore: fix CI
1 parent e5c6304 commit e1bd8bf

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

.github/workflows/tests.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,27 @@ jobs:
180180
#snapshot_source=$(./script/upgrades.sh snapshot-source ${{ github.ref }})
181181
echo "TEST_REQUIRED=$test_required" >> $GITHUB_ENV
182182
#echo "SNAPSHOT_SOURCE=$snapshot_source" >> $GITHUB_ENV
183+
- name: Fix Go module cache permissions
184+
if: env.TEST_REQUIRED != ''
185+
run: |
186+
# Fix permissions on Go module cache to prevent permission denied errors
187+
# This is needed because sudo cleanup may have affected cache permissions
188+
if [ -d "$HOME/go/pkg/mod" ]; then
189+
sudo chown -R $(id -u):$(id -g) "$HOME/go/pkg/mod" 2>/dev/null || true
190+
fi
191+
# Ensure Go cache directories exist with correct permissions
192+
mkdir -p "$HOME/go/pkg/mod/cache/download"
193+
chmod -R u+w "$HOME/go/pkg/mod" 2>/dev/null || true
183194
- name: run test
184195
id: test
185196
if: env.TEST_REQUIRED != ''
186197
env:
187198
TEST_CONFIG: test-config-gha.json
199+
GOMODCACHE: ${{ runner.temp }}/go-mod-cache
200+
GOCACHE: ${{ runner.temp }}/go-build-cache
188201
run: |
202+
# Ensure cache directories exist with correct permissions
203+
mkdir -p "$GOMODCACHE" "$GOCACHE"
189204
cd tests/upgrade
190205
make test
191206
- name: upload validator(s) stdout/stderr

0 commit comments

Comments
 (0)