ci: upload coverage only on linux #8
This file contains 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: strings/bexp | |
concurrency: | |
group: strings/bexp-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
push: | |
branches: [ main ] | |
paths: | |
- "strings/bexp/**" | |
- ".github/workflows/strings-bexp.yaml" | |
defaults: | |
run: | |
working-directory: ./strings/bexp | |
jobs: | |
test: | |
strategy: | |
matrix: | |
platform: [ubuntu-latest, macos-latest, windows-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '>=1.21.5' | |
- name: Run tests and generate coverage report | |
run: | | |
go test -race -coverpkg=./... -coverprofile=coverage.out ./... | |
- name: Install goveralls | |
if: ${{ matrix.platform == 'ubuntu-latest' }} | |
run: go install github.com/mattn/goveralls@latest | |
- name: Send coverage | |
if: ${{ matrix.platform == 'ubuntu-latest' }} | |
env: | |
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: goveralls -parallel -flagname="strings/bexp" -coverprofile=coverage.out -service=github | |
finish: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: '>=1.21.5' | |
- name: Install goveralls | |
working-directory: ${{ github.workspace }} | |
env: | |
GO111MODULE: off | |
run: go install github.com/mattn/goveralls@latest | |
- name: Finalize send coverage | |
working-directory: ${{ github.workspace }} | |
env: | |
COVERALLS_TOKEN: ${{ github.token }} | |
GIT_BRANCH: ${{ github.head_ref }} | |
run: goveralls -parallel-finish -service=github |