Merge remote-tracking branch 'origin/main' #47
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
# This workflow will build a golang project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | |
name: Go | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ "main", "dev" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go: [ '1.21', '1.22', '1.23' ] | |
name: Go ${{ matrix.go }} sample | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Build | |
run: go build -v ./... | |
- name: Test | |
run: go test ./... -coverprofile=./cover.out -covermode=atomic -coverpkg=./... | |
- name: check test coverage | |
uses: vladopajic/go-test-coverage@v2 | |
with: | |
config: ./.testcoverage.yml | |
profile: cover.out | |
local-prefix: github.com/manuelarte/milogo | |
## when token is not specified (value '') this feature is turned off | |
## in this example badge is created and committed only for main branch | |
git-token: ${{ github.ref_name == 'main' && secrets.GITHUB_TOKEN || '' }} | |
## name of branch where badges are stored | |
## ideally this should be orphan branch (see below how to create this branch) | |
git-branch: badges |