Add GitHub Action with Actions cache backend #103
Workflow file for this run
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: | |
| push: | |
| branches: [main] | |
| tags: ["v*"] | |
| pull_request: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Activate Hermit | |
| run: echo "${GITHUB_WORKSPACE}/bin" >> "$GITHUB_PATH" | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 21 | |
| - name: Test | |
| run: go test -run ^Test -timeout 300s ./... | |
| - name: Build | |
| run: go build ./... | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Activate Hermit | |
| run: echo "${GITHUB_WORKSPACE}/bin" >> "$GITHUB_PATH" | |
| - name: Lint | |
| run: golangci-lint run | |
| release: | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| needs: [test, lint] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Activate Hermit | |
| run: echo "${GITHUB_WORKSPACE}/bin" >> "$GITHUB_PATH" | |
| - name: Release | |
| run: goreleaser release --clean | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |