crowdsec/.github/workflows/go-tests-windows.yml
2022-09-05 10:02:46 +02:00

52 lines
1 KiB
YAML

name: Go tests (windows)
on:
push:
branches: [master]
paths-ignore:
- 'README.md'
pull_request:
branches: [master]
paths-ignore:
- 'README.md'
env:
RICHGO_FORCE_COLOR: 1
jobs:
build:
name: "Build + tests"
runs-on: windows-2022
strategy:
matrix:
build-type: ["build", "static"]
steps:
- name: "Set up Go 1.19"
uses: actions/setup-go@v3
with:
go-version: 1.19
id: go
- name: Check out CrowdSec repository
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: false
- name: Build
run: |
make ${{ matrix.build-type }}
- name: Run tests
run: |
go install github.com/kyoh86/richgo@v0.3.10
go test -coverprofile coverage.out -covermode=atomic ./... > out.txt
cat out.txt | sed 's/ *coverage:.*of statements in.*//' | richgo testfilter
- name: Upload unit coverage to Codecov
uses: codecov/codecov-action@v2
with:
files: coverage.out
flags: unit-windows