|
1 | | -name: ci |
2 | | - |
3 | | -on: |
4 | | - push: |
5 | | - branches: [dev] |
6 | | - pull_request: |
7 | | - branches: [dev] |
8 | | - workflow_dispatch: |
9 | | - |
10 | | -jobs: |
11 | | - unit: |
12 | | - runs-on: ubuntu-22.04 |
13 | | - steps: |
14 | | - - name: Checkout |
15 | | - uses: actions/checkout@v4 |
16 | | - with: |
17 | | - submodules: recursive |
18 | | - |
| 1 | +name: ci |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [dev] |
| 6 | + pull_request: |
| 7 | + branches: [dev] |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +jobs: |
| 11 | + unit: |
| 12 | + runs-on: ubuntu-22.04 |
| 13 | + steps: |
| 14 | + - name: Checkout |
| 15 | + uses: actions/checkout@v4 |
| 16 | + with: |
| 17 | + submodules: recursive |
| 18 | + |
19 | 19 | - name: Set up Go |
20 | 20 | uses: actions/setup-go@v5 |
21 | 21 | with: |
22 | 22 | go-version: "1.24.13" |
23 | 23 | cache: false |
24 | | - |
25 | | - - name: Go mod tidy |
26 | | - run: go mod tidy |
27 | | - |
28 | | - - name: Go vet |
29 | | - run: go vet ./... |
30 | | - |
31 | | - - name: Test inventory |
32 | | - run: go run ./scripts/testinventory -output dist/testing |
33 | | - |
34 | | - - name: Go test |
35 | | - run: go test ./... -count=1 -timeout 300s |
36 | | - |
37 | | - - name: Go build |
38 | | - run: go build ./... |
39 | | - env: |
40 | | - CGO_ENABLED: 0 |
41 | | - |
42 | | - race: |
43 | | - runs-on: ubuntu-22.04 |
44 | | - steps: |
45 | | - - name: Checkout |
46 | | - uses: actions/checkout@v4 |
47 | | - with: |
48 | | - submodules: recursive |
49 | | - |
| 24 | + |
| 25 | + - name: Go mod tidy |
| 26 | + run: go mod tidy |
| 27 | + |
| 28 | + - name: Go vet |
| 29 | + run: go vet ./... |
| 30 | + |
| 31 | + - name: Test inventory |
| 32 | + run: go run ./scripts/testinventory -output dist/testing |
| 33 | + |
| 34 | + - name: Go test |
| 35 | + run: go test ./... -count=1 -timeout 300s |
| 36 | + |
| 37 | + - name: Go build |
| 38 | + run: go build ./... |
| 39 | + env: |
| 40 | + CGO_ENABLED: 0 |
| 41 | + |
| 42 | + race: |
| 43 | + runs-on: ubuntu-22.04 |
| 44 | + steps: |
| 45 | + - name: Checkout |
| 46 | + uses: actions/checkout@v4 |
| 47 | + with: |
| 48 | + submodules: recursive |
| 49 | + |
50 | 50 | - name: Set up Go |
51 | 51 | uses: actions/setup-go@v5 |
52 | 52 | with: |
53 | 53 | go-version: "1.24.13" |
54 | 54 | cache: false |
55 | | - |
56 | | - - name: Go mod tidy |
57 | | - run: go mod tidy |
58 | | - |
59 | | - - name: Race detection — core, parser, stream |
60 | | - run: >- |
61 | | - go test -race -count=1 -timeout 300s |
62 | | - ./server/internal/core |
63 | | - ./server/internal/parser/... |
64 | | - ./server/internal/stream |
65 | | -
|
| 55 | + |
| 56 | + - name: Go mod tidy |
| 57 | + run: go mod tidy |
| 58 | + |
| 59 | + - name: Race detection — core, parser, stream |
| 60 | + run: >- |
| 61 | + go test -race -count=1 -timeout 300s |
| 62 | + ./server/internal/core |
| 63 | + ./server/internal/parser/... |
| 64 | + ./server/internal/stream |
| 65 | +
|
66 | 66 | mock_implant: |
67 | 67 | runs-on: ubuntu-22.04 |
68 | 68 | steps: |
69 | 69 | - name: Checkout |
70 | 70 | uses: actions/checkout@v4 |
71 | | - with: |
72 | | - submodules: recursive |
73 | | - |
| 71 | + with: |
| 72 | + submodules: recursive |
| 73 | + |
74 | 74 | - name: Set up Go |
75 | 75 | uses: actions/setup-go@v5 |
76 | 76 | with: |
77 | 77 | go-version: "1.24.13" |
78 | 78 | cache: false |
79 | | - |
| 79 | + |
80 | 80 | - name: Go mod tidy |
81 | 81 | run: go mod tidy |
82 | 82 |
|
| 83 | + - name: Discover mock implant packages |
| 84 | + shell: bash |
| 85 | + run: echo "MOCKIMPLANT_PACKAGES=$(go run ./scripts/testmatrix -layer mockimplant)" >> "$GITHUB_ENV" |
| 86 | + |
| 87 | + - name: Show mock implant package selection |
| 88 | + run: echo "$MOCKIMPLANT_PACKAGES" |
| 89 | + |
83 | 90 | - name: Mock implant E2E tests |
84 | | - run: go test -tags=mockimplant ./server -count=1 -timeout 300s |
| 91 | + run: go test -tags=mockimplant $MOCKIMPLANT_PACKAGES -count=1 -timeout 300s |
85 | 92 |
|
86 | 93 | integration: |
87 | 94 | runs-on: ubuntu-22.04 |
88 | 95 | steps: |
89 | 96 | - name: Checkout |
90 | | - uses: actions/checkout@v4 |
91 | | - with: |
92 | | - submodules: recursive |
93 | | - |
| 97 | + uses: actions/checkout@v4 |
| 98 | + with: |
| 99 | + submodules: recursive |
| 100 | + |
94 | 101 | - name: Set up Go |
95 | 102 | uses: actions/setup-go@v5 |
96 | 103 | with: |
97 | 104 | go-version: "1.24.13" |
98 | 105 | cache: false |
99 | | - |
| 106 | + |
100 | 107 | - name: Go mod tidy |
101 | 108 | run: go mod tidy |
102 | 109 |
|
| 110 | + - name: Discover integration packages |
| 111 | + shell: bash |
| 112 | + run: echo "INTEGRATION_PACKAGES=$(go run ./scripts/testmatrix -layer integration)" >> "$GITHUB_ENV" |
| 113 | + |
| 114 | + - name: Show integration package selection |
| 115 | + run: echo "$INTEGRATION_PACKAGES" |
| 116 | + |
103 | 117 | - name: Client/Server integration tests |
104 | | - run: go test -tags=integration ./server ./client/command/listener ./client/command/pipeline ./client/command/website ./client/command/sessions ./client/command/context -count=1 -timeout 300s |
| 118 | + run: go test -tags=integration $INTEGRATION_PACKAGES -count=1 -timeout 300s |
0 commit comments