2022-06-17 14:12:49 +00:00
|
|
|
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
|
2022-09-05 08:02:46 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
build-type: ["build", "static"]
|
2022-06-17 14:12:49 +00:00
|
|
|
steps:
|
|
|
|
|
2022-08-26 11:31:49 +00:00
|
|
|
- name: "Set up Go 1.19"
|
2022-06-17 14:12:49 +00:00
|
|
|
uses: actions/setup-go@v3
|
|
|
|
with:
|
2022-08-26 11:31:49 +00:00
|
|
|
go-version: 1.19
|
2022-06-17 14:12:49 +00:00
|
|
|
id: go
|
|
|
|
|
|
|
|
- name: Check out CrowdSec repository
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
submodules: false
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: |
|
2022-09-05 08:02:46 +00:00
|
|
|
make ${{ matrix.build-type }}
|
2022-06-17 14:12:49 +00:00
|
|
|
|
|
|
|
- name: Run tests
|
|
|
|
run: |
|
|
|
|
go install github.com/kyoh86/richgo@v0.3.10
|
2022-07-22 08:59:23 +00:00
|
|
|
go test -coverprofile coverage.out -covermode=atomic ./... > out.txt
|
|
|
|
cat out.txt | sed 's/ *coverage:.*of statements in.*//' | richgo testfilter
|
2022-06-17 14:12:49 +00:00
|
|
|
|
|
|
|
- name: Upload unit coverage to Codecov
|
|
|
|
uses: codecov/codecov-action@v2
|
|
|
|
with:
|
|
|
|
files: coverage.out
|
|
|
|
flags: unit-windows
|