From 0e6a13ef060a0bffb7997088993b848308d329f3 Mon Sep 17 00:00:00 2001 From: Claudio Matsuoka Date: Tue, 16 Sep 2025 15:53:14 -0300 Subject: [PATCH] test: build local spread binary Don't rely on GitHub runners providing a (potentially outdated) spread binary. Instead, check out a reference version and build a local binary to be used in the github CI test. Signed-off-by: Claudio Matsuoka --- .github/workflows/test.yaml | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 9b09af5e..f4b89466 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -11,13 +11,35 @@ on: jobs: run-tests: - runs-on: self-hosted + #runs-on: [self-hosted, spread-enabled] + runs-on: [self-hosted] steps: - uses: actions/checkout@v4 - - name: Run tests + - name: Run unit tests run: | - spread google: + sudo snap install go --classic + go test -v ./... + + - name: Build local spread + run: | + mkdir spread-testing + cd spread-testing + git init + git remote add origin https://github.com/canonical/spread.git + git fetch --depth=1 origin ae284792596e00d325a1787604fe4ec7e00574aa + git checkout FETCH_HEAD + go build -o spread-testing ./cmd/spread + sudo cp spread-testing /usr/bin/spread + cd .. + rm -Rf spread-testing + + - name: Run spread tests + env: + SPREAD_GOOGLE_KEY: ${{ secrets.SPREAD_GOOGLE_KEY }} + run: | + echo "$SPREAD_GOOGLE_KEY" | sha1sum + /usr/bin/spread google: - name: Discard spread workers if: always()