Skip to content

Commit bcc2bce

Browse files
author
David Robertson
authored
Fix CI by ensuring gotestfmt is on PATH, plus cleanups (matrix-org#634)
* Use setup-go action This was my first attempt to fix CI. Go 1.17 is no longer available on runners (actions/runner-images#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. * Bump checkout action Drive-by fix for matrix-org/synapse#14203 * Check that gotestfmt is installed no `-version` flag, so `help` will have to do * `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.
1 parent 93b2410 commit bcc2bce

File tree

1 file changed

+6
-18
lines changed

1 file changed

+6
-18
lines changed

.github/workflows/ci.yaml

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,9 @@ jobs:
1414
complement-internal:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v2 # Checkout complement
18-
- name: "Set Go Version"
19-
run: |
20-
echo "$GOROOT_1_17_X64/bin" >> $GITHUB_PATH
21-
echo "~/go/bin" >> $GITHUB_PATH
17+
- uses: actions/checkout@v3 # Checkout complement
18+
- uses: actions/setup-go@v4
2219
- name: "Install Complement Dependencies"
23-
# We don't need to install Go because it is included on the Ubuntu 20.04 image:
24-
# See https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md specifically GOROOT_1_17_X64
2520
run: |
2621
sudo apt-get update && sudo apt-get install -y libolm3 libolm-dev
2722
- name: "Run internal Complement tests"
@@ -53,27 +48,20 @@ jobs:
5348
timeout: 10m
5449

5550
steps:
56-
- uses: actions/checkout@v2 # Checkout complement
57-
58-
# Env vars are set file a file given by $GITHUB_PATH. We need both Go 1.17 and GOPATH on env.
59-
# See https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-system-path
60-
- name: "Set Go Version"
61-
run: |
62-
echo "$GOROOT_1_17_X64/bin" >> $GITHUB_PATH
63-
echo "~/go/bin" >> $GITHUB_PATH
51+
- uses: actions/checkout@v3 # Checkout complement
6452

53+
- uses: actions/setup-go@v4
6554
# Similar steps as dockerfiles/ComplementCIBuildkite.Dockerfile but on the host. We need
6655
# to do this so we can _be_ the host when running Complement so we can snaffle all the ports. If
6756
# we run Complement _in_ Docker then we can't -p all high numbered ports which then breaks federation
6857
# servers which listen on random high numbered ports.
6958
- name: "Install Complement Dependencies"
70-
# We don't need to install Go because it is included on the Ubuntu 20.04 image:
71-
# See https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md specifically GOROOT_1_17_X64
7259
run: |
7360
sudo apt-get update && sudo apt-get install -y libolm3 libolm-dev
74-
go get -v github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
61+
go install -v github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
7562
mkdir .gotestfmt/github -p
7663
cp .ci/complement_package.gotpl .gotestfmt/github/package.gotpl
64+
gotestfmt -help
7765
7866
- name: "Checkout corresponding ${{ matrix.homeserver }} branch"
7967
shell: bash

0 commit comments

Comments
 (0)