Skip to content

Refactoring and fixes #9

Refactoring and fixes

Refactoring and fixes #9

Workflow file for this run

name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ^1.22
cache: true
- name: Check out code
uses: actions/checkout@v4
- name: Get dependencies
run: go mod download
- name: Format check
run: |
gofmt -l -d $(find . -type f -name '*.go' -not -path "./vendor/*")
if [ "$(gofmt -l $(find . -type f -name '*.go' -not -path "./vendor/*") | wc -l)" -gt 0 ]; then
echo "Code is not formatted. Please run 'make format'"
exit 1
fi
- name: Build
run: go build -v ./...
- name: Test
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
file: ./coverage.txt
fail_ci_if_error: false