github.com/crowdsecurity/crowdsec@v1.6.1/.github/workflows/go-tests-windows.yml (about)

     1  name: Go tests (windows)
     2  
     3  on:
     4    push:
     5      branches:
     6        - master
     7        - releases/**
     8      paths-ignore:
     9        - 'README.md'
    10    pull_request:
    11      branches:
    12        - master
    13        - releases/**
    14      paths-ignore:
    15        - 'README.md'
    16  
    17  env:
    18    RICHGO_FORCE_COLOR: 1
    19    CROWDSEC_FEATURE_DISABLE_HTTP_RETRY_BACKOFF: true
    20  
    21  jobs:
    22    build:
    23      name: "Build + tests"
    24      runs-on: windows-2022
    25  
    26      steps:
    27  
    28      - name: Check out CrowdSec repository
    29        uses: actions/checkout@v4
    30        with:
    31          fetch-depth: 0
    32          submodules: false
    33  
    34      - name: "Set up Go"
    35        uses: actions/setup-go@v5
    36        with:
    37          go-version: "1.21.9"
    38  
    39      - name: Build
    40        run: |
    41          make build BUILD_RE2_WASM=1
    42  
    43      - name: Run tests
    44        run: |
    45          go install github.com/kyoh86/richgo@v0.3.10
    46          go test -coverprofile coverage.out -covermode=atomic ./... > out.txt
    47          if(!$?) { cat out.txt | sed 's/ *coverage:.*of statements in.*//' | richgo testfilter; Exit 1 }
    48          cat out.txt | sed 's/ *coverage:.*of statements in.*//' | richgo testfilter
    49  
    50      - name: Upload unit coverage to Codecov
    51        uses: codecov/codecov-action@v4
    52        with:
    53          files: coverage.out
    54          flags: unit-windows
    55  
    56      - name: golangci-lint
    57        uses: golangci/golangci-lint-action@v4
    58        with:
    59          version: v1.57
    60          args: --issues-exit-code=1 --timeout 10m
    61          only-new-issues: false
    62          # the cache is already managed above, enabling it here
    63          # gives errors when extracting
    64          skip-pkg-cache: true
    65          skip-build-cache: true