Skip to content

Commit 7e180e4

Browse files
authored
ci: split tests in several namespaces (#5117)
1 parent eaa6547 commit 7e180e4

File tree

2 files changed

+90
-28
lines changed

2 files changed

+90
-28
lines changed

.github/workflows/unit-tests.yaml renamed to .github/workflows/build.yml

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Tests
1+
name: Build
22

33
permissions:
44
contents: read
@@ -8,16 +8,9 @@ on:
88
merge_group:
99

1010
jobs:
11-
os-tests:
12-
strategy:
13-
matrix:
14-
platform: [ubuntu-latest, macos-latest, windows-latest]
15-
runs-on: ${{ matrix.platform }}
11+
native-binary:
12+
runs-on: ubuntu-latest
1613
steps:
17-
- name: Set git to use LF to avoid problem with goldens on windows
18-
run: |
19-
git config --global core.autocrlf false
20-
git config --global core.eol lf
2114
# Checkout should always be before setup-go to ensure caching is working
2215
- name: Checkout
2316
uses: actions/checkout@v5
@@ -31,31 +24,14 @@ jobs:
3124
run: |
3225
go mod tidy
3326
git diff --exit-code
34-
- name: Run unit tests
35-
run: go tool gotestsum --format github-actions
36-
- name: Execute main binary # Test the runtime for potential panics.
37-
run: go run cmd/scw/main.go -h
38-
39-
build-tests:
40-
runs-on: ubuntu-latest
41-
steps:
42-
# Checkout should always be before setup-go to ensure caching is working
43-
- name: Checkout
44-
uses: actions/checkout@v5
45-
with:
46-
fetch-depth: 1
47-
- name: Install Go
48-
uses: actions/setup-go@v6
49-
with:
50-
go-version: stable
5127
- name: Build binaries
5228
run: ./scripts/build.sh
5329
- name: Print binaries size
5430
run: ls -lh ./bin
5531
- name: Check binary size
5632
run: ./scripts/check-size.sh ./bin/*linux-x86_64
5733

58-
docker-tests:
34+
docker:
5935
runs-on: ubuntu-latest
6036
steps:
6137
- name: Checkout

.github/workflows/tests.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Tests
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request:
8+
merge_group:
9+
10+
jobs:
11+
namespaces:
12+
strategy:
13+
matrix:
14+
platform:
15+
- ubuntu-latest
16+
- macos-latest
17+
- windows-latest
18+
products:
19+
- account
20+
- applesilicon
21+
- baremetal
22+
- billing
23+
- block
24+
- cockpit
25+
- container
26+
- dedibox
27+
- domain
28+
- edge_services
29+
- flexibleip
30+
- function
31+
- iam
32+
- inference
33+
- init
34+
- instance
35+
- iot
36+
- ipam
37+
- jobs
38+
- k8s
39+
- key_manager
40+
- lb
41+
- login
42+
- marketplace
43+
- mnq
44+
- mongodb
45+
- object
46+
- rdb
47+
- redis
48+
- registry
49+
- serverless_sqldb
50+
- secret
51+
- tem
52+
- vpc
53+
- vpcgw
54+
- webhosting
55+
runs-on: ${{ matrix.platform }}
56+
steps:
57+
- name: Set git to use LF to avoid problem with goldens on windows
58+
run: |
59+
git config --global core.autocrlf false
60+
git config --global core.eol lf
61+
# Checkout should always be before setup-go to ensure caching is working
62+
- name: Checkout
63+
uses: actions/checkout@v5
64+
with:
65+
fetch-depth: 1
66+
- name: Install Go
67+
uses: actions/setup-go@v6
68+
with:
69+
go-version: stable
70+
- name: Run tests
71+
run: go tool gotestsum --format github-actions -- -v ./internal/namespaces/${{ matrix.products }}/...
72+
- name: Execute main binary # Test the runtime for potential panics.
73+
run: go run cmd/scw/main.go -h
74+
others:
75+
runs-on: ubuntu-latest
76+
steps:
77+
- name: Checkout
78+
uses: actions/checkout@v5
79+
with:
80+
fetch-depth: 1
81+
- name: Install Go
82+
uses: actions/setup-go@v6
83+
with:
84+
go-version: stable
85+
- name: Run tests outside of products namespaces
86+
run: go list ./... | grep -v 'internal/namespaces' | xargs go tool gotestsum --format github-actions -- -v

0 commit comments

Comments
 (0)