From f296bc31a8eb9474fbd3cc0457aa3ec3bb798607 Mon Sep 17 00:00:00 2001 From: Alberto Bertogli Date: Sun, 17 May 2020 09:54:26 +0100 Subject: [PATCH] cirrus: Allow the testing user to write to $GOPATH Cirrus CI caches the module directory inside $GOPATH so it can be shared between test runs, to speed them up. However, it is currently created as root, which causes new entries to fail since they run under the "testing" user. This patch fixes that problem by making the "testing" user own the entire $GOPATH, which includes the module directory. --- .cirrus.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.cirrus.yml b/.cirrus.yml index 12f6746..030bdd4 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -17,6 +17,8 @@ linux_task: folder: $GOPATH/pkg/mod get_script: | useradd --create-home --user-group testing + chown -R testing:testing $GOPATH/ + su testing -c "go mod download" su testing -c "go get ./..." build_script: | su testing -c "go build ./..."