From ae3d3fc78ca6eba560ffd04ac333795c6dcaffe7 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Thu, 6 Apr 2023 13:45:18 +0100 Subject: [PATCH 1/4] Use setup-go action This was my first attempt to fix CI. Go 1.17 is no longer available on runners (https://github.com/actions/runner-images/issues/7276 maybe) and I wondered if that might help with that. Unfortunately I think not. But we should get some go build caching as a side effect of using this action. --- .github/workflows/ci.yaml | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d51a8cf9..18867661 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -15,13 +15,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 # Checkout complement - - name: "Set Go Version" - run: | - echo "$GOROOT_1_17_X64/bin" >> $GITHUB_PATH - echo "~/go/bin" >> $GITHUB_PATH + - uses: actions/setup-go@v4 - name: "Install Complement Dependencies" - # We don't need to install Go because it is included on the Ubuntu 20.04 image: - # See https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md specifically GOROOT_1_17_X64 run: | sudo apt-get update && sudo apt-get install -y libolm3 libolm-dev - name: "Run internal Complement tests" @@ -55,20 +50,12 @@ jobs: steps: - uses: actions/checkout@v2 # Checkout complement - # Env vars are set file a file given by $GITHUB_PATH. We need both Go 1.17 and GOPATH on env. - # See https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-system-path - - name: "Set Go Version" - run: | - echo "$GOROOT_1_17_X64/bin" >> $GITHUB_PATH - echo "~/go/bin" >> $GITHUB_PATH - + - uses: actions/setup-go@v4 # Similar steps as dockerfiles/ComplementCIBuildkite.Dockerfile but on the host. We need # to do this so we can _be_ the host when running Complement so we can snaffle all the ports. If # we run Complement _in_ Docker then we can't -p all high numbered ports which then breaks federation # servers which listen on random high numbered ports. - name: "Install Complement Dependencies" - # We don't need to install Go because it is included on the Ubuntu 20.04 image: - # See https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md specifically GOROOT_1_17_X64 run: | sudo apt-get update && sudo apt-get install -y libolm3 libolm-dev go get -v github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest From 35a1a16864567584830080fa20c61ebb3732da67 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Thu, 6 Apr 2023 13:46:48 +0100 Subject: [PATCH 2/4] Bump checkout action Drive-by fix for https://github.com/matrix-org/synapse/issues/14203 --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 18867661..81ddc41c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -14,7 +14,7 @@ jobs: complement-internal: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 # Checkout complement + - uses: actions/checkout@v3 # Checkout complement - uses: actions/setup-go@v4 - name: "Install Complement Dependencies" run: | @@ -48,7 +48,7 @@ jobs: timeout: 10m steps: - - uses: actions/checkout@v2 # Checkout complement + - uses: actions/checkout@v3 # Checkout complement - uses: actions/setup-go@v4 # Similar steps as dockerfiles/ComplementCIBuildkite.Dockerfile but on the host. We need From 102ca4ab3293bc66ec18d4ef5f7f60ad2b39f1ed Mon Sep 17 00:00:00 2001 From: David Robertson Date: Thu, 6 Apr 2023 14:12:59 +0100 Subject: [PATCH 3/4] Check that gotestfmt is installed no `-version` flag, so `help` will have to do --- .github/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 81ddc41c..3053cd3a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -61,6 +61,7 @@ jobs: go get -v github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest mkdir .gotestfmt/github -p cp .ci/complement_package.gotpl .gotestfmt/github/package.gotpl + gotestfmt -help - name: "Checkout corresponding ${{ matrix.homeserver }} branch" shell: bash From 1d9e633de2d153afb5d4a1222e69c15a887ac794 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Thu, 6 Apr 2023 14:20:38 +0100 Subject: [PATCH 4/4] `go install gotestfmt` instead of `go get` IDK why this suddenly started failing, but `go install` seems to put it on the PATH in a way that makes CI work. --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3053cd3a..5f87e784 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -58,7 +58,7 @@ jobs: - name: "Install Complement Dependencies" run: | sudo apt-get update && sudo apt-get install -y libolm3 libolm-dev - go get -v github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest + go install -v github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest mkdir .gotestfmt/github -p cp .ci/complement_package.gotpl .gotestfmt/github/package.gotpl gotestfmt -help