Merge remote-tracking branch 'origin/main' into main #57
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: "Test" | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - main | |
| paths-ignore: | |
| - 'docs/**' | |
| - '.run/**' | |
| - '.vscode/**' | |
| - '*.md' | |
| pull_request: | |
| types: [ opened, synchronize ] | |
| branches: | |
| - master | |
| - main | |
| paths-ignore: | |
| - 'docs/**' | |
| - '.run/**' | |
| - '.vscode/**' | |
| - '*.md' | |
| workflow_dispatch: | |
| jobs: | |
| # Run unit tests | |
| unit: | |
| name: "Run unit tests" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: 1.23.0 | |
| # todo skip mocks coverage | |
| - name: Install dependencies and run tests | |
| run: | | |
| go mod download | |
| go test -v ./... -coverpkg=./... -short -coverprofile=unit_coverage.out | |
| - name: Archive code coverage results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: code-coverage | |
| path: unit_coverage.out | |
| code_coverage: | |
| name: "Code coverage report" | |
| if: github.event_name == 'pull_request' # Do not run when workflow is triggered by push to main branch | |
| runs-on: ubuntu-latest | |
| needs: [ unit ] | |
| continue-on-error: true # not critical | |
| permissions: | |
| contents: read | |
| actions: read | |
| pull-requests: write # write permission needed to comment on PR | |
| steps: | |
| - uses: fgrosse/[email protected] | |
| with: | |
| coverage-artifact-name: code-coverage | |
| coverage-file-name: unit_coverage.out |