|
9 | 9 | - main |
10 | 10 | env: |
11 | 11 | DD_APPSEC_WAF_TIMEOUT: 5s |
12 | | - GODEBUG: cgocheck=2 # highest level of run-time cgo checks |
13 | 12 | jobs: |
14 | 13 | native: |
15 | 14 | strategy: |
| 15 | + fail-fast: false |
16 | 16 | matrix: |
17 | 17 | runs-on: [ macos-13, macos-12, macos-11, ubuntu-22.04, ubuntu-20.04, windows-latest ] |
18 | 18 | go-version: [ "1.20", "1.19", "1.18" ] |
19 | | - cgo_enabled: # test it compiles with and without cgo |
20 | | - - 0 |
21 | | - - 1 |
22 | | - fail-fast: false |
| 19 | + cgo_enabled: [ "0", "1" ] # test it compiles with and without cgo |
| 20 | + include: |
| 21 | + - env: |
| 22 | + GODEBUG=cgocheck=2 |
23 | 23 | runs-on: ${{ matrix.runs-on }} |
24 | 24 | steps: |
25 | 25 | - uses: actions/checkout@v3 |
26 | | - - uses: actions/setup-go@v3 |
| 26 | + - uses: actions/setup-go@v4 |
27 | 27 | with: |
28 | 28 | go-version: ${{ matrix.go-version }} |
29 | 29 | cache: true |
30 | 30 |
|
31 | | - - name: Go modules cache |
32 | | - uses: actions/cache@v3 |
33 | | - with: |
34 | | - path: ~/go/pkg/mod |
35 | | - key: go-pkg-mod-${{ hashFiles('**/go.sum') }} |
36 | | - restore-keys: go-pkg-mod- |
37 | | - |
38 | 31 | - name: go test |
39 | 32 | shell: bash |
40 | 33 | run: | |
41 | 34 | # Install gotestsum |
42 | 35 | env GOBIN=$PWD go install gotest.tools/gotestsum@latest |
43 | 36 | # Run the tests with gotestsum |
44 | | - env CGO_ENABLED=${{ matrix.cgo_enabled }} ./gotestsum -- -v -count=10 -shuffle=on ./... |
| 37 | + env ${{ matrix.env }} CGO_ENABLED=${{ matrix.cgo_enabled }} ./gotestsum -- -v -count=10 -shuffle=on ./... |
45 | 38 |
|
46 | 39 | # Same tests but on the official golang container for linux |
47 | 40 | golang-linux-container: |
48 | 41 | runs-on: ubuntu-latest |
49 | 42 | container: |
50 | 43 | image: golang:${{ matrix.go-version }}-${{ matrix.distribution }} |
51 | 44 | strategy: |
52 | | - matrix: |
53 | | - go-version: [ "1.20", "1.19", "1.18" ] |
54 | | - distribution: [ bullseye, buster, alpine ] |
55 | | - cgo_enabled: # test it compiles with and without cgo |
56 | | - - 0 |
57 | | - - 1 |
58 | 45 | fail-fast: false |
| 46 | + matrix: |
| 47 | + go-version: [ "1.21-rc", "1.20", "1.19", "1.18" ] |
| 48 | + distribution: [ bookworm, bullseye, buster, alpine ] |
| 49 | + cgo_enabled: [ "0", "1" ] # test it compiles with and without cgo |
| 50 | + exclude: |
| 51 | + - go-version: 1.18 |
| 52 | + distribution: bookworm |
| 53 | + - go-version: 1.21-rc |
| 54 | + distribution: buster |
59 | 55 | steps: |
60 | 56 | - uses: actions/checkout@v3 |
| 57 | + |
61 | 58 | # Install gcc and the libc headers on alpine images |
62 | 59 | - if: ${{ matrix.distribution == 'alpine' }} |
63 | | - run: apk add gcc musl-dev libc6-compat git |
| 60 | + run: apk add gcc musl-dev libc6-compat |
64 | 61 |
|
65 | 62 | - name: Go modules cache |
66 | 63 | uses: actions/cache@v3 |
|
80 | 77 | runs-on: ubuntu-latest |
81 | 78 | strategy: |
82 | 79 | matrix: |
83 | | - cgo_enabled: # test it compiles with and without the cgo |
84 | | - - 0 |
85 | | - - 1 |
| 80 | + cgo_enabled: [ "0", "1" ] # test it compiles with and without the cgo |
86 | 81 | fail-fast: false |
87 | 82 | steps: |
88 | 83 | - uses: actions/checkout@v3 |
|
0 commit comments