Merge pull request #105 from embano1/dependabot/github_actions/action… #184
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: Tests | |
| on: | |
| push: | |
| branches: ["main", "master"] | |
| pull_request: | |
| branches: ["main", "master", "release-*"] | |
| jobs: | |
| test: | |
| name: Go Tests | |
| strategy: | |
| matrix: | |
| go-version: ["1.21","1.22","1.23"] | |
| platform: ["ubuntu-latest", "windows-latest"] | |
| runs-on: ${{ matrix.platform }} | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v5 | |
| - name: Set up Go ${{ matrix.go-version }} | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ matrix.go-version }} | |
| id: go | |
| - name: Install tparse | |
| run: go install github.com/mfridman/tparse@latest | |
| - name: Check for .codecov.yaml | |
| id: codecov-enabled | |
| uses: andstor/file-existence-action@v3 | |
| with: | |
| files: .codecov.yaml | |
| - if: steps.codecov-enabled.outputs.files_exists == 'true' | |
| name: Enable Go Coverage | |
| run: echo 'COVER_OPTS=-coverprofile=coverage.txt -covermode=atomic' >> $GITHUB_ENV | |
| - name: Test | |
| env: | |
| GOFLAGS: "-v -race -count=1 -json" | |
| run: go test $COVER_OPTS ./... | tparse -all -notests -format markdown >> $GITHUB_STEP_SUMMARY | |
| - name: Verify git clean | |
| shell: bash | |
| run: | | |
| if [[ -z "$(git status --porcelain)" ]]; then | |
| echo "${{ github.repository }} up to date." | |
| else | |
| echo "${{ github.repository }} is dirty." | |
| echo "::error:: $(git status)" | |
| exit 1 | |
| fi | |
| - if: steps.codecov-enabled.outputs.files_exists == 'true' | |
| name: Produce Codecov Report | |
| uses: codecov/codecov-action@v5 |