Skip to content

Commit

Permalink
Fix CI by ensuring gotestfmt is on PATH, plus cleanups (#634)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
David Robertson committed Apr 6, 2023
1 parent 93b2410 commit bcc2bce
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,9 @@ jobs:
complement-internal:
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/checkout@v3 # Checkout complement
- 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"
Expand Down Expand Up @@ -53,27 +48,20 @@ jobs:
timeout: 10m

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/checkout@v3 # Checkout complement

- 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
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
- name: "Checkout corresponding ${{ matrix.homeserver }} branch"
shell: bash
Expand Down

0 comments on commit bcc2bce

Please sign in to comment.