chore: improve AI bug automation readiness #171
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: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| release: | |
| types: | |
| - created | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| check-latest: true | |
| - name: Run tests | |
| run: make test | |
| - name: Run linter | |
| run: make lint | |
| dev-container: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| check-latest: true | |
| - name: Login to container registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ secrets.CONTAINER_REGISTRY }} | |
| username: ${{ secrets.CONTAINER_REGISTRY_USERNAME }} | |
| password: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }} | |
| - name: Build and push dev image | |
| env: | |
| VERSION: dev | |
| CONTAINER_TAGS: dev | |
| run: | | |
| make publish | |
| release-container: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| if: github.event_name == 'release' | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| check-latest: true | |
| - name: Set version information for release | |
| id: version | |
| run: | | |
| VERSION="${GITHUB_REF#refs/tags/}" | |
| echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | |
| echo "TAGS=$VERSION,latest" >> $GITHUB_OUTPUT | |
| - name: Login to container registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ secrets.CONTAINER_REGISTRY }} | |
| username: ${{ secrets.CONTAINER_REGISTRY_USERNAME }} | |
| password: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }} | |
| - name: Build and push image | |
| env: | |
| VERSION: ${{ steps.version.outputs.VERSION }} | |
| CONTAINER_TAGS: ${{ steps.version.outputs.TAGS }} | |
| run: | | |
| make publish | |
| release-binary: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| if: github.event_name == 'release' | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| check-latest: true | |
| - name: Run GoReleaser | |
| uses: goreleaser/goreleaser-action@v6 | |
| with: | |
| distribution: goreleaser | |
| version: latest | |
| args: release --clean | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |