From fe0361a5b87713a5cc03b016aaf7e3c7d2fe0f75 Mon Sep 17 00:00:00 2001 From: Jakub Date: Tue, 13 Jun 2023 10:29:01 +0200 Subject: [PATCH] ci: fix GOCACHE and GOPATH to avoid poisoning (#125) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We've had this issue before with some `go-waku` builds: https://github.com/waku-org/go-waku/pull/512 Signed-off-by: Jakub SokoĊ‚owski --- ci/Jenkinsfile.prs.linux | 11 ++++++----- ci/Jenkinsfile.prs.macos | 13 +++++++------ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/ci/Jenkinsfile.prs.linux b/ci/Jenkinsfile.prs.linux index 2ca5a876..814026ca 100644 --- a/ci/Jenkinsfile.prs.linux +++ b/ci/Jenkinsfile.prs.linux @@ -7,8 +7,9 @@ pipeline { } environment { - GOPATH = '/tmp/go' - GOCACHE = '/tmp/' + /* Avoid cache poisoning by other jobs. */ + GOCACHE = "${env.WORKSPACE_TMP}/go-build" + GOPATH = "${env.WORKSPACE_TMP}/go" } options { @@ -22,9 +23,9 @@ pipeline { stages { stage('Check') { steps { - sh 'cargo check --all --all-features' - sh 'cargo fmt -- --check' - sh 'cargo clippy --all --all-features -- --deny warnings' + sh 'cargo check --all --all-features' + sh 'cargo fmt -- --check' + sh 'cargo clippy --all --all-features -- --deny warnings' } } diff --git a/ci/Jenkinsfile.prs.macos b/ci/Jenkinsfile.prs.macos index 5eea828d..da7b8dd6 100644 --- a/ci/Jenkinsfile.prs.macos +++ b/ci/Jenkinsfile.prs.macos @@ -2,12 +2,13 @@ library 'status-jenkins-lib@v1.6.0' pipeline { agent { - label 'macos && aarch64' + label 'macos && aarch64 && nix-2.11' } environment { - GOPATH = '/tmp/go' - GOCACHE = '/tmp/' + /* Avoid cache poisoning by other jobs. */ + GOCACHE = "${env.WORKSPACE_TMP}/go-build" + GOPATH = "${env.WORKSPACE_TMP}/go" } options { @@ -21,9 +22,9 @@ pipeline { stages { stage('Check') { steps { script { - nix.shell('cargo check --all --all-features') - nix.shell('cargo fmt -- --check') - nix.shell('cargo clippy --all --all-features -- --deny warnings') + nix.shell('cargo check --all --all-features') + nix.shell('cargo fmt -- --check') + nix.shell('cargo clippy --all --all-features -- --deny warnings') } } }