Skip to content

Commit 21441ad

Browse files
committed
Separate main CI tests and CRD2Go CI
Signed-off-by: jose.vazquez <jose.vazquez@mongodb.com>
1 parent 64233d8 commit 21441ad

File tree

5 files changed

+136
-50
lines changed

5 files changed

+136
-50
lines changed

.github/workflows/crd2go.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# CRD2Go CI
2+
name: CRD2Go CI
3+
4+
on:
5+
push:
6+
branches: [ "main" ]
7+
paths:
8+
- 'tools/crd2go/**'
9+
pull_request:
10+
branches: [ "main" ]
11+
paths:
12+
- 'tools/crd2go/**'
13+
14+
jobs:
15+
16+
build:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v5
20+
with:
21+
ref: ${{github.event.pull_request.head.sha}}
22+
23+
- name: Set up Go
24+
uses: actions/setup-go@v5
25+
with:
26+
go-version: '1.24'
27+
28+
- name: Build
29+
run: go build -v ./...
30+
31+
- name: Test
32+
run: go test -race -cover -v ./...
33+
34+
- name: golangci-lint
35+
uses: golangci/golangci-lint-action@v8
36+
with:
37+
version: v2.1
38+
39+
gci:
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v5
43+
with:
44+
ref: ${{github.event.pull_request.head.sha}}
45+
46+
- name: Install devbox
47+
uses: jetify-com/devbox-install-action@v0.13.0
48+
with:
49+
enable-cache: 'true'
50+
project-path: 'tools/crd2go'
51+
52+
- name: gci
53+
run: |
54+
echo "Did you run gofmt-gci?"
55+
devbox run -- 'gci write --skip-generated -s standard -s default -s localmodule . && \
56+
git diff-index --name-only HEAD && git diff-index --quiet HEAD --'
57+
58+
licenses:
59+
runs-on: ubuntu-latest
60+
steps:
61+
- uses: actions/checkout@v5
62+
with:
63+
ref: ${{github.event.pull_request.head.sha}}
64+
65+
- name: Install devbox
66+
uses: jetify-com/devbox-install-action@v0.13.0
67+
with:
68+
enable-cache: 'true'
69+
project-path: 'tools/crd2go'
70+
71+
- name: Check license headers
72+
run: |
73+
devbox run -- 'addlicense \
74+
-check \
75+
-l apache \
76+
-c "MongoDB Inc" \
77+
-ignore "**/*.md" \
78+
-ignore "**/*.yaml" \
79+
-ignore "**/*.yml" \
80+
-ignore "**/*.nix" .'

.github/workflows/test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ on:
88
- 'main'
99
paths-ignore:
1010
- 'docs/**'
11+
- 'tools/**'
1112
pull_request_target:
1213
types: [opened, synchronize, reopened, ready_for_review, converted_to_draft, labeled]
1314
branches:
1415
- '**'
1516
paths-ignore:
1617
- 'docs/**'
18+
- 'tools/**'
1719
merge_group:
1820
workflow_dispatch:
1921
inputs:
@@ -25,6 +27,9 @@ on:
2527
options:
2628
- "true"
2729
- "false"
30+
paths-ignore:
31+
- 'docs/**'
32+
- 'tools/**'
2833

2934
jobs:
3035
run-tests:

tools/crd2go/.github/workflows/go.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

tools/crd2go/devbox.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.14.0/.schema/devbox.schema.json",
33
"packages": [
4-
"neovim@latest",
4+
"git@latest",
55
"go@latest",
66
"vscodium@latest",
77
"kubernetes-controller-tools@latest",
88
"gh@latest",
99
"gci@latest",
10-
"golangci-lint@latest"
10+
"golangci-lint@latest",
11+
"addlicense@latest"
1112
],
1213
"shell": {
1314
"init_hook": [

tools/crd2go/devbox.lock

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,54 @@
11
{
22
"lockfile_version": "1",
33
"packages": {
4+
"addlicense@latest": {
5+
"last_modified": "2025-07-28T17:09:23Z",
6+
"resolved": "github:NixOS/nixpkgs/648f70160c03151bc2121d179291337ad6bc564b#addlicense",
7+
"source": "devbox-search",
8+
"version": "1.1.1",
9+
"systems": {
10+
"aarch64-darwin": {
11+
"outputs": [
12+
{
13+
"name": "out",
14+
"path": "/nix/store/r3lhc2n8xj5ns43zrfdx1d4rsk6l0zgy-addlicense-1.1.1",
15+
"default": true
16+
}
17+
],
18+
"store_path": "/nix/store/r3lhc2n8xj5ns43zrfdx1d4rsk6l0zgy-addlicense-1.1.1"
19+
},
20+
"aarch64-linux": {
21+
"outputs": [
22+
{
23+
"name": "out",
24+
"path": "/nix/store/smjx8fp2r6ikxr6fv6vd9nws8j546hs3-addlicense-1.1.1",
25+
"default": true
26+
}
27+
],
28+
"store_path": "/nix/store/smjx8fp2r6ikxr6fv6vd9nws8j546hs3-addlicense-1.1.1"
29+
},
30+
"x86_64-darwin": {
31+
"outputs": [
32+
{
33+
"name": "out",
34+
"path": "/nix/store/gpfw7kfm0rm4gcpnz2cgkb3d4zxyn32s-addlicense-1.1.1",
35+
"default": true
36+
}
37+
],
38+
"store_path": "/nix/store/gpfw7kfm0rm4gcpnz2cgkb3d4zxyn32s-addlicense-1.1.1"
39+
},
40+
"x86_64-linux": {
41+
"outputs": [
42+
{
43+
"name": "out",
44+
"path": "/nix/store/mxb6kb1b7lfklzmz020m0rdf7ppn0608-addlicense-1.1.1",
45+
"default": true
46+
}
47+
],
48+
"store_path": "/nix/store/mxb6kb1b7lfklzmz020m0rdf7ppn0608-addlicense-1.1.1"
49+
}
50+
}
51+
},
452
"gci@latest": {
553
"last_modified": "2025-08-05T11:35:34Z",
654
"resolved": "github:NixOS/nixpkgs/a683adc19ff5228af548c6539dbc3440509bfed3#gci",

0 commit comments

Comments
 (0)