Skip to content

Fix CI run condition to cover PRs from forks (#42) #117

Fix CI run condition to cover PRs from forks (#42)

Fix CI run condition to cover PRs from forks (#42) #117

Workflow file for this run

name: Tests
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.19.x'
- name: Install dependencies
run: go get .
- name: Build Linux
run: GOOS=linux GOARCH=amd64 go build .
- name: Build Windows
run: GOOS=windows GOARCH=amd64 go build .
- name: Build MacOS
run: GOOS=darwin GOARCH=amd64 go build .
- name: Test
run: |
go test -v ./... -covermode=count -coverprofile="coverage.out"
go tool cover -func="coverage.out"
- name: Check format
run: |
if gofmt -e -l . >&1 | grep '^'; then
exit 1
fi