mirror of
https://github.com/seriousm4x/UpSnap.git
synced 2026-07-24 06:24:07 -04:00
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4 to 5. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
37 lines
1.1 KiB
YAML
37 lines
1.1 KiB
YAML
name: go test
|
|
|
|
on:
|
|
push:
|
|
paths: backend/**
|
|
|
|
jobs:
|
|
check-runner:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
runner-label: ${{ steps.set-runner.outputs.runner-label }}
|
|
steps:
|
|
- name: Set runner
|
|
id: set-runner
|
|
run: |
|
|
runners=$(curl -s -H "Accept: application/vnd.github+json" -H "Authorization: token ${{ secrets.REPO_ACCESS_TOKEN }}" "https://api.github.com/repos/${{ github.repository }}/actions/runners")
|
|
available=$(echo "$runners" | jq '.runners[] | select(.status == "online" and .busy == false and .labels[] .name == "self-hosted")')
|
|
if [ -n "$available" ]; then
|
|
echo "runner-label=self-hosted" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "runner-label=ubuntu-latest" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
build:
|
|
needs: check-runner
|
|
runs-on: ${{ needs.check-runner.outputs.runner-label }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: ">=1.21"
|
|
- name: Test
|
|
run: |
|
|
cd backend
|
|
go test -exec sudo -v ./...
|