Repository navigation
Scaffold Workflow #3404
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: Scaffold Workflow | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| pull_request: | |
| paths: | |
| - "scaffold/**" | |
| - ".github/workflows/scaffold.yml" | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "scaffold/**" | |
| - ".github/workflows/scaffold.yml" | |
| permissions: | |
| contents: read | |
| jobs: | |
| scaffold: | |
| timeout-minutes: 30 | |
| name: "scaffold" | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./scaffold | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| with: | |
| fetch-depth: 2 | |
| - name: Set up Go 1.x | |
| id: setup-go | |
| uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7 | |
| with: | |
| go-version-file: scaffold/go.mod | |
| cache: false | |
| - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6 | |
| with: | |
| path: | | |
| ~/.cache/go-build | |
| ~/go/pkg/mod | |
| key: ${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-test-scaffold-${{ hashFiles('scaffold/go.sum') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-test-scaffold- | |
| - name: golangci-lint | |
| uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9 | |
| with: | |
| version: v2.14.0 | |
| working-directory: scaffold | |
| - name: Build | |
| run: go build . | |
| - name: Test | |
| run: make test | |
| validate-release: | |
| timeout-minutes: 30 | |
| runs-on: ubuntu-latest | |
| env: | |
| CGO_ENABLED: 0 | |
| steps: | |
| - name: Checkout | |
| if: startsWith(github.head_ref, 'release-please--branches--main--components') || github.event_name == 'push' | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| - name: Set up Go | |
| if: startsWith(github.head_ref, 'release-please--branches--main--components') || github.event_name == 'push' | |
| id: setup-go | |
| uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7 | |
| with: | |
| go-version-file: scaffold/go.mod | |
| cache: false | |
| - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6 | |
| if: startsWith(github.head_ref, 'release-please--branches--main--components') || github.event_name == 'push' | |
| with: | |
| path: | | |
| ~/.cache/go-build | |
| ~/go/pkg/mod | |
| key: ${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-release-cache-scaffold-${{ hashFiles('scaffold/go.sum') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-release-cache-scaffold- | |
| - name: Install GoReleaser | |
| if: startsWith(github.head_ref, 'release-please--branches--main--components') || github.event_name == 'push' | |
| uses: goreleaser/goreleaser-action@f06c13b6b1a9625abc9e6e439d9c05a8f2190e94 # v7 | |
| with: | |
| distribution: goreleaser-pro | |
| version: "v2.14.3" | |
| install-only: true | |
| - name: Run GoReleaser Dry-Run | |
| if: startsWith(github.head_ref, 'release-please--branches--main--components') || github.event_name == 'push' | |
| run: goreleaser release --snapshot --clean --skip=validate,publish,sign -f ./scaffold/.goreleaser.yaml | |
| env: | |
| GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} |