chore(deps): update actions/checkout action to v7 #145
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build golang executable on push | |
| on: | |
| # Renovate branch-automerges without opening a PR, so `pull_request` alone | |
| # leaves those branches untested - and untested means renovate has nothing to | |
| # wait for before it fast-forwards main. | |
| push: | |
| branches: | |
| - renovate/** | |
| pull_request: | |
| jobs: | |
| go-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7 | |
| with: | |
| go-version-file: go.mod | |
| - name: Vet | |
| run: go vet ./... | |
| - name: Run tests | |
| run: go test -race ./... | |
| golang-build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| os: | |
| - linux | |
| - windows | |
| - darwin | |
| arch: | |
| - amd64 | |
| - arm64 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - uses: thetillhoff/action-golang-build@b94bf8d46bc2dd0f7324fcbd0c6530838943976e # v1.1.0 | |
| with: | |
| OS: "${{ matrix.os }}" | |
| ARCH: "${{ matrix.arch }}" | |
| BUILDARGS: -ldflags="-X github.com/thetillhoff/temingo/cmd.version=${{ github.ref_name }}" | |
| verify-version: | |
| needs: golang-build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| merge-multiple: true | |
| - name: Verify version | |
| shell: bash | |
| run: | | |
| # Make executable executable | |
| chmod +x ./temingo_linux_amd64 | |
| # Check version using --version flag | |
| VERSION_OUTPUT=$(./temingo_linux_amd64 --version 2>&1 || echo "dev") | |
| VERSION_OUTPUT=$(echo "$VERSION_OUTPUT" | tr -d '\n\r' | xargs) # Trim whitespace and newlines | |
| echo "Version output: '$VERSION_OUTPUT'" | |
| # Verify version matches the tag (this also catches "dev" since it won't match) | |
| EXPECTED_VERSION="${{ github.ref_name }}" | |
| if [[ "$VERSION_OUTPUT" != "$EXPECTED_VERSION" ]]; then | |
| echo "ERROR: Version mismatch! Expected: '$EXPECTED_VERSION', Got: '$VERSION_OUTPUT'" | |
| exit 1 | |
| fi | |
| echo "✓ Version verification passed: $VERSION_OUTPUT" |