2022-06-17 14:12:49 +00:00
|
|
|
name: Go tests (windows)
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2022-11-28 09:52:42 +00:00
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- releases/**
|
2022-06-17 14:12:49 +00:00
|
|
|
paths-ignore:
|
|
|
|
- 'README.md'
|
|
|
|
pull_request:
|
2022-11-28 09:52:42 +00:00
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- releases/**
|
2022-06-17 14:12:49 +00:00
|
|
|
paths-ignore:
|
|
|
|
- 'README.md'
|
|
|
|
|
|
|
|
env:
|
|
|
|
RICHGO_FORCE_COLOR: 1
|
2023-01-09 13:49:21 +00:00
|
|
|
CROWDSEC_FEATURE_DISABLE_HTTP_RETRY_BACKOFF: true
|
2022-06-17 14:12:49 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: "Build + tests"
|
|
|
|
runs-on: windows-2022
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Check out CrowdSec repository
|
2024-01-30 09:20:25 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-06-17 14:12:49 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
submodules: false
|
|
|
|
|
2024-01-30 09:20:25 +00:00
|
|
|
- name: "Set up Go"
|
|
|
|
uses: actions/setup-go@v5
|
2023-02-28 16:25:09 +00:00
|
|
|
with:
|
2024-04-05 13:11:11 +00:00
|
|
|
go-version: "1.21.9"
|
2023-02-28 16:25:09 +00:00
|
|
|
|
2022-06-17 14:12:49 +00:00
|
|
|
- name: Build
|
|
|
|
run: |
|
2023-06-23 12:25:29 +00:00
|
|
|
make build BUILD_RE2_WASM=1
|
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
|
2022-09-28 14:18:00 +00:00
|
|
|
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
|
2022-06-17 14:12:49 +00:00
|
|
|
|
|
|
|
- name: Upload unit coverage to Codecov
|
2024-03-14 13:04:45 +00:00
|
|
|
uses: codecov/codecov-action@v4
|
2022-06-17 14:12:49 +00:00
|
|
|
with:
|
|
|
|
files: coverage.out
|
|
|
|
flags: unit-windows
|
2023-03-08 13:50:59 +00:00
|
|
|
|
|
|
|
- name: golangci-lint
|
2024-03-14 13:04:45 +00:00
|
|
|
uses: golangci/golangci-lint-action@v4
|
2023-03-08 13:50:59 +00:00
|
|
|
with:
|
2024-03-26 08:30:32 +00:00
|
|
|
version: v1.57
|
2023-03-08 13:50:59 +00:00
|
|
|
args: --issues-exit-code=1 --timeout 10m
|
|
|
|
only-new-issues: false
|
2023-03-20 09:41:08 +00:00
|
|
|
# the cache is already managed above, enabling it here
|
|
|
|
# gives errors when extracting
|
|
|
|
skip-pkg-cache: true
|
|
|
|
skip-build-cache: true
|