Skip to content

Commit 8022bc8

Browse files
committed
Expand CI coverage for tagged test suites
1 parent 1b0fb54 commit 8022bc8

8 files changed

Lines changed: 1095 additions & 748 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 80 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,118 @@
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+
1919
- name: Set up Go
2020
uses: actions/setup-go@v5
2121
with:
2222
go-version: "1.24.13"
2323
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+
5050
- name: Set up Go
5151
uses: actions/setup-go@v5
5252
with:
5353
go-version: "1.24.13"
5454
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+
6666
mock_implant:
6767
runs-on: ubuntu-22.04
6868
steps:
6969
- name: Checkout
7070
uses: actions/checkout@v4
71-
with:
72-
submodules: recursive
73-
71+
with:
72+
submodules: recursive
73+
7474
- name: Set up Go
7575
uses: actions/setup-go@v5
7676
with:
7777
go-version: "1.24.13"
7878
cache: false
79-
79+
8080
- name: Go mod tidy
8181
run: go mod tidy
8282

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+
8390
- 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
8592

8693
integration:
8794
runs-on: ubuntu-22.04
8895
steps:
8996
- name: Checkout
90-
uses: actions/checkout@v4
91-
with:
92-
submodules: recursive
93-
97+
uses: actions/checkout@v4
98+
with:
99+
submodules: recursive
100+
94101
- name: Set up Go
95102
uses: actions/setup-go@v5
96103
with:
97104
go-version: "1.24.13"
98105
cache: false
99-
106+
100107
- name: Go mod tidy
101108
run: go mod tidy
102109

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+
103117
- 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

.github/workflows/realimplant.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: realimplant
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
real_implant:
8+
runs-on:
9+
- self-hosted
10+
- windows
11+
env:
12+
MALICE_REAL_IMPLANT_RUN: "1"
13+
MALICE_REAL_IMPLANT_WORKSPACE: ${{ vars.MALICE_REAL_IMPLANT_WORKSPACE }}
14+
MALICE_REAL_IMPLANT_BIN: ${{ vars.MALICE_REAL_IMPLANT_BIN }}
15+
MALICE_REAL_IMPLANT_MUTANT: ${{ vars.MALICE_REAL_IMPLANT_MUTANT }}
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
submodules: recursive
21+
22+
- name: Set up Go
23+
uses: actions/setup-go@v5
24+
with:
25+
go-version: "1.24.13"
26+
cache: false
27+
28+
- name: Validate real implant environment
29+
shell: pwsh
30+
run: |
31+
if ([string]::IsNullOrWhiteSpace($env:MALICE_REAL_IMPLANT_BIN)) {
32+
throw "Repository variable MALICE_REAL_IMPLANT_BIN is required."
33+
}
34+
if ([string]::IsNullOrWhiteSpace($env:MALICE_REAL_IMPLANT_MUTANT)) {
35+
throw "Repository variable MALICE_REAL_IMPLANT_MUTANT is required."
36+
}
37+
38+
- name: Go mod tidy
39+
run: go mod tidy
40+
41+
- name: Real implant E2E tests
42+
shell: pwsh
43+
run: |
44+
$packages = go run ./scripts/testmatrix -layer realimplant -format lines
45+
$packages | ForEach-Object { Write-Host $_ }
46+
go test -tags=realimplant $packages -count=1 -timeout 600s

0 commit comments

Comments
 (0)