Skip to content

Bugfix/fix GitHub workflows folder name #5

Bugfix/fix GitHub workflows folder name

Bugfix/fix GitHub workflows folder name #5

Workflow file for this run

name: Generate code coverage badge
on:
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
name: Update coverage badge
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
- name: Setup go
uses: actions/setup-go@v2
with:
go-version: '1.21.1'
- name: Install dependencies
run: go work sync
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run Test
run: |
go test -v ./wscengine -covermode=count -coverprofile=coverage.out
go tool cover -func=coverage.out -o=coverage.out