Update release.yml (#8) #24
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
on: | |
push: | |
branches: | |
- develop | |
pull_request: | |
branches: | |
- develop | |
name: run tests | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
cache: false | |
- name: Run linters | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: v1.54 | |
test: | |
strategy: | |
matrix: | |
go-version: [ 1.20.x, 1.21.x, 1.22.x ] | |
platform: [ ubuntu-latest, macos-latest, windows-latest ] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Go | |
if: success() | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Run tests | |
run: go test -v -covermode=count ./... | |
coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Go | |
if: success() | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
- name: Calc coverage | |
run: | | |
go test -v -covermode=count -coverprofile=coverage.out ./... | |
- name: Convert coverage.out to coverage.lcov | |
uses: jandelgado/gcov2lcov-action@v1 | |
- name: Coveralls | |
uses: coverallsapp/github-action@v2 | |
with: | |
github-token: ${{ secrets.github_token }} | |
files: coverage.lcov |