Merge pull request #128 from dokku/127-cleanup-old-docker-images #191
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" | |
| # yamllint disable-line rule:truthy | |
| on: | |
| pull_request: | |
| branches: | |
| - "*" | |
| push: | |
| branches: | |
| - "main" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| go-test: | |
| name: go-test | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-go@v7 | |
| with: | |
| go-version-file: "go.mod" | |
| - run: go get . | |
| - name: Run tests with coverage | |
| run: go test -v -coverprofile=coverage.out ./internal/... | |
| - name: Write coverage summary | |
| if: always() | |
| run: | | |
| if [ ! -f coverage.out ]; then | |
| echo "coverage.out not produced (test binary likely failed to compile)" >> "$GITHUB_STEP_SUMMARY" | |
| exit 0 | |
| fi | |
| total=$(go tool cover -func=coverage.out | tail -1 | awk '{print $NF}') | |
| { | |
| echo "## Test coverage: ${total}" | |
| echo "" | |
| echo '```' | |
| go tool cover -func=coverage.out | |
| echo '```' | |
| } >> "$GITHUB_STEP_SUMMARY" | |
| - name: Upload coverage profile | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: coverage-profile | |
| path: coverage.out | |
| retention-days: 7 |