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-02-14 08:47:12 +00:00
|
|
|
go-version: "1.21.7"
|
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
|
2022-10-24 10:48:25 +00:00
|
|
|
uses: codecov/codecov-action@v3
|
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
|
|
|
|
uses: golangci/golangci-lint-action@v3
|
|
|
|
with:
|
2023-12-21 11:30:20 +00:00
|
|
|
version: v1.55
|
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
|