Update tools and deps #385
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: | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| inputs: | |
| proto_ref: | |
| proto_sha: | |
| push: | |
| branches: | |
| - main | |
| # Publish `v1.2.3` tags as releases. | |
| tags: | |
| - v* | |
| # Run tests for PRs | |
| pull_request: | |
| env: | |
| VAULT_ADDR: https://vault.eng.aserto.com/ | |
| BUF_REPO: "buf.build/aserto-dev/directory" | |
| BUF_VERSION: 1.52.1 | |
| BUF_BETA_SUPPRESS_WARNINGS: 1 | |
| GO_VERSION: 1.24 | |
| GO_LANGCI_LINT_VERSION: v2.0.2 | |
| GO_TESTSUM_VERSION: 1.12.1 | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - | |
| uses: actions/create-github-app-token@v1 | |
| id: app-token | |
| with: | |
| app-id: ${{ vars.CODEGEN_APP_ID }} | |
| private-key: ${{ secrets.CODEGEN_APP_KEY }} | |
| - | |
| name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ steps.app-token.outputs.token }} | |
| - | |
| name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| - | |
| name: Setup buf | |
| uses: bufbuild/buf-action@v1 | |
| with: | |
| version: ${{ env.BUF_VERSION }} | |
| setup_only: true | |
| - | |
| name: Delete generated code | |
| run: | | |
| rm -rf ./aserto | |
| - | |
| name: Get latest version tag from Buf Registry | |
| id: buf-latest | |
| run: | | |
| echo "VERSION=$(buf registry module label list ${BUF_REPO} --format json | jq -r '.labels[0].name')" >> "$GITHUB_OUTPUT" | |
| - | |
| name: Buf Generate | |
| run: | | |
| echo "${{ env.BUF_REPO }}:${{ steps.buf-latest.outputs.VERSION }}" | |
| buf generate ${{ env.BUF_REPO }}:${{ steps.buf-latest.outputs.VERSION }} | |
| - | |
| name: Lint | |
| uses: golangci/golangci-lint-action@v7 | |
| with: | |
| version: ${{ env.GO_LANGCI_LINT_VERSION }} | |
| args: --timeout=5m | |
| - | |
| name: Test Setup | |
| uses: gertd/action-gotestsum@v3.0.0 | |
| with: | |
| gotestsum_version: ${{ env.GO_TESTSUM_VERSION }} | |
| - | |
| name: Test | |
| run: | | |
| gotestsum --format short-verbose -- -count=1 -parallel=1 -v -timeout=240s -coverprofile=cover.out -coverpkg=./... ./... | |
| - | |
| name: Commit changes | |
| if: github.event_name == 'workflow_dispatch' | |
| uses: EndBug/add-and-commit@v9 | |
| with: | |
| default_author: github_actions | |
| add: 'aserto' |