Something went wrong. Try again.
cli + tui to publish to leaflet (wip) & manage tasks, notes & watch/read lists 🍃
charm leaflet readability golang
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263name: Test and Coverage
on: push: branches: [ main, master ] pull_request: branches: [ main, master ]
jobs: test: runs-on: ubuntu-latest
strategy: matrix: go-version: [1.24.x]
steps: - uses: actions/checkout@v4
- name: Set up Go uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }}
- name: Cache Go modules uses: actions/cache@v4 with: path: | ~/.cache/go-build ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go-
- name: Download dependencies run: go mod download
- name: Verify dependencies run: go mod verify
- name: Run tests run: go test -v -race -coverprofile=coverage.out -covermode=atomic ./...
- name: Generate coverage report run: go tool cover -html=coverage.out -o coverage.html
- name: Upload coverage reports to Codecov uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} file: ./coverage.out flags: unittests name: codecov-umbrella fail_ci_if_error: false
- name: Upload coverage artifact uses: actions/upload-artifact@v4 with: name: coverage-report path: | coverage.out coverage.html