Refactor hub management and cscli commands #3071
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Go tests (windows) | |
on: | |
push: | |
branches: | |
- master | |
- hub-1.5.6 | |
- releases/** | |
paths-ignore: | |
- 'README.md' | |
pull_request: | |
branches: | |
- master | |
- hub-1.5.6 | |
- releases/** | |
paths-ignore: | |
- 'README.md' | |
env: | |
RICHGO_FORCE_COLOR: 1 | |
CROWDSEC_FEATURE_DISABLE_HTTP_RETRY_BACKOFF: true | |
jobs: | |
build: | |
strategy: | |
matrix: | |
go-version: ["1.21.4"] | |
name: "Build + tests" | |
runs-on: windows-2022 | |
steps: | |
- name: Check out CrowdSec repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: false | |
- name: "Set up Go ${{ matrix.go-version }}" | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Build | |
run: | | |
make build BUILD_RE2_WASM=1 | |
- name: Run tests | |
run: | | |
go install github.com/kyoh86/[email protected] | |
go test -coverprofile coverage.out -covermode=atomic ./... > out.txt | |
if(!$?) { cat out.txt | sed 's/ *coverage:.*of statements in.*//' | richgo testfilter; Exit 1 } | |
cat out.txt | sed 's/ *coverage:.*of statements in.*//' | richgo testfilter | |
- name: Upload unit coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
files: coverage.out | |
flags: unit-windows | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: v1.54 | |
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 |