diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 9b09af5e..dcd6c12c 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 + run: | + uname -a + trap 'rm -f key.json' EXIT + echo "${{ secrets.SPREAD_GOOGLE_KEY }}" | base64 -d > key.json + /usr/bin/spread google: - name: Discard spread workers if: always() diff --git a/spread.yaml b/spread.yaml index 982e71c2..912560d3 100644 --- a/spread.yaml +++ b/spread.yaml @@ -16,7 +16,7 @@ environment: backends: google: - key: "$(HOST: echo $SPREAD_GOOGLE_KEY)" + key: key.json location: snapd-spread/us-east1-b halt-timeout: 2h systems: