crowdsec/.github/workflows/go-tests-windows.yml

66 lines
1.5 KiB
YAML
Raw Normal View History

name: Go tests (windows)
on:
push:
branches:
- master
- releases/**
paths-ignore:
- 'README.md'
pull_request:
branches:
- master
- releases/**
paths-ignore:
- 'README.md'
env:
RICHGO_FORCE_COLOR: 1
CROWDSEC_FEATURE_DISABLE_HTTP_RETRY_BACKOFF: true
jobs:
build:
name: "Build + tests"
runs-on: windows-2022
steps:
- name: Check out CrowdSec repository
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: false
- name: "Set up Go"
uses: actions/setup-go@v5
2023-02-28 16:25:09 +00:00
with:
go-version: "1.21.9"
2023-02-28 16:25:09 +00:00
- name: Build
run: |
make build BUILD_RE2_WASM=1
- 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
if(!$?) { cat out.txt | sed 's/ *coverage:.*of statements in.*//' | richgo testfilter; Exit 1 }
2022-07-22 08:59:23 +00:00
cat out.txt | sed 's/ *coverage:.*of statements in.*//' | richgo testfilter
- name: Upload unit coverage to Codecov
2024-03-14 13:04:45 +00:00
uses: codecov/codecov-action@v4
with:
files: coverage.out
flags: unit-windows
- name: golangci-lint
2024-03-14 13:04:45 +00:00
uses: golangci/golangci-lint-action@v4
with:
2024-03-26 08:30:32 +00:00
version: v1.57
args: --issues-exit-code=1 --timeout 10m
only-new-issues: false
# the cache is already managed above, enabling it here
# gives errors when extracting
skip-pkg-cache: true
skip-build-cache: true