Skip to content

Commit

Permalink
install-slsactl: Skip tests on tag push
Browse files Browse the repository at this point in the history
Avoids the race condition whereby the install-slsactl attempts to
download binaries from the project, while they are being built and
published by a different action.

Signed-off-by: Paulo Gomes <[email protected]>
  • Loading branch information
pjbgf committed Dec 10, 2024
1 parent ef90536 commit 7b4ae8a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/test-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ name: Test Actions

on:
push:
tags-ignore:
# Ignore release tags, as the install-slsactl will probably
# be executed before the release takes place, causing it to
# fail as it will try to download the binaries of the current
# release, which may or may not be available.
- 'v*'

pull_request:
workflow_dispatch:

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@ jobs:
uses: actions/checkout@v4

- uses: ./actions/install-slsactl
with:
version: ${{ github.sha }}
- run: make e2e
6 changes: 6 additions & 0 deletions actions/install-slsactl/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ runs:
echo "Using last tag ${VERSION} as version"
fi
if [[ ! "${VERSION}" =~ ^v ]]; then
echo 'Version is not 'latest' nor starts with "v". Fallback to go install with commit ID."
go install "github.com/rancherlabs/slsactl@${VERSION}"
exit $?
fi
echo "Downloading checksum file and signatures for release ${VERSION}"
curl -LO "https://${REPO}/releases/download/${VERSION}/slsactl_${VERSION#v}_checksums.txt.pem"
curl -LO "https://${REPO}/releases/download/${VERSION}/slsactl_${VERSION#v}_checksums.txt.sig"
Expand Down

0 comments on commit 7b4ae8a

Please sign in to comment.