Skip to content

Commit e86e03f

Browse files
authored
Merge pull request #560 from kolyshkin/ci
Modernize CI (a bit)
2 parents ecf16be + 93dcd63 commit e86e03f

37 files changed

+56
-6439
lines changed

.cirrus.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ config_task:
8787
- dnf install -y make glib2-devel git gcc golang
8888
- cd $CIRRUS_WORKING_DIR
8989
- make config
90-
- ./hack/tree_status.sh
90+
- git diff --exit-code
9191

9292

9393
# Verify code was fmt'ed properly
@@ -102,7 +102,7 @@ fmt_task:
102102
- dnf install -y clang clang-tools-extra golang
103103
- cd $CIRRUS_WORKING_DIR
104104
- make fmt
105-
- ./hack/tree_status.sh
105+
- git diff --exit-code
106106

107107

108108
# Build the static binary

.github/workflows/integration.yml

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,31 @@ on:
44
tags:
55
- v*
66
branches:
7-
- master
7+
- main
88
pull_request:
9+
910
jobs:
11+
1012
conmon:
1113
runs-on: ubuntu-latest
1214
steps:
15+
- uses: actions/checkout@v4
1316
- uses: actions/setup-go@v5
1417
with:
1518
go-version: '1.22'
16-
- uses: actions/checkout@v4
17-
- uses: actions/cache@v4
18-
with:
19-
path: |
20-
~/go/pkg/mod
21-
~/.cache/go-build
22-
key: go-integration-conmon-${{ hashFiles('**/go.mod') }}
23-
restore-keys: go-integration-conmon-
2419
- run: sudo hack/github-actions-setup
2520
- name: Run conmon integration tests
2621
run: |
27-
sudo make vendor
2822
sudo mkdir -p /var/run/crio
2923
sudo make test-binary
3024
3125
cri-o:
3226
runs-on: ubuntu-latest
3327
steps:
28+
- uses: actions/checkout@v4
3429
- uses: actions/setup-go@v5
3530
with:
3631
go-version: '1.22'
37-
- uses: actions/checkout@v4
38-
- uses: actions/cache@v4
39-
with:
40-
path: |
41-
~/go/pkg/mod
42-
~/.cache/go-build
43-
key: go-integration-cri-o-${{ hashFiles('**/go.mod') }}
44-
restore-keys: go-integration-cri-o-
4532
- run: sudo hack/github-actions-setup
4633
- name: Run CRI-O integration tests
4734
run: |
@@ -52,3 +39,11 @@ jobs:
5239
sudo sh -c "cd $CRIO_DIR; ./test/test_runner.sh"
5340
env:
5441
JOBS: '2'
42+
43+
all-done:
44+
needs:
45+
- conmon
46+
- cri-o
47+
runs-on: ubuntu-24.04
48+
steps:
49+
- run: echo "All jobs completed"

.github/workflows/validate.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: validate
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
branches:
7+
- main
8+
- release-*
9+
pull_request:
10+
env:
11+
GO_VERSION: 1.24
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
17+
deps:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: install go
22+
uses: actions/setup-go@v5
23+
with:
24+
go-version: "${{ env.GO_VERSION }}"
25+
- name: Verify Go dependencies
26+
run: |
27+
make vendor
28+
git diff --exit-code
29+
30+
all-done:
31+
needs:
32+
- deps
33+
runs-on: ubuntu-latest
34+
steps:
35+
- run: echo "All jobs completed"

Makefile

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,10 @@ bin:
8787

8888
.PHONY: vendor
8989
vendor:
90-
GO111MODULE=on $(GO) mod tidy
91-
GO111MODULE=on $(GO) mod vendor
92-
GO111MODULE=on $(GO) mod verify
90+
$(GO) mod tidy
91+
$(GO) mod verify
9392

9493
.PHONY: docs
95-
ifeq ($(GOMD2MAN),)
96-
docs: install.tools
97-
endif
9894
docs:
9995
$(MAKE) -C docs
10096

@@ -123,14 +119,10 @@ install.podman: bin/conmon
123119
install ${SELINUXOPT} -d -m 755 $(DESTDIR)$(LIBEXECDIR)/podman
124120
install ${SELINUXOPT} -m 755 bin/conmon $(DESTDIR)$(LIBEXECDIR)/podman/conmon
125121

126-
install.tools:
127-
$(MAKE) -C tools
128-
129122
.PHONY: fmt
130123
fmt:
131-
find . '(' -name '*.h' -o -name '*.c' ! -path './vendor/*' ! -path './tools/vendor/*' ')' -exec clang-format -i {} \+
132-
find . -name '*.go' ! -path './vendor/*' ! -path './tools/vendor/*' -exec gofmt -s -w {} \+
133-
git diff --exit-code
124+
git ls-files -z \*.c \*.h | xargs -0 clang-format -i
125+
gofmt -s -w .
134126

135127

136128
.PHONY: dbuild

docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PREFIX ?= /usr/local
22
DATADIR := ${PREFIX}/share
33
MANDIR := $(DATADIR)/man
4-
GOMD2MAN ?= ../tools/build/go-md2man
4+
GOMD2MAN ?= go-md2man
55

66
docs: $(patsubst %.md,%,$(wildcard *.8.md))
77

hack/github-actions-setup

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ install_packages() {
8080
}
8181

8282
install_conmon() {
83-
sudo make install
83+
sudo make install.bin
8484
conmon --version
8585
}
8686

hack/kubernetes-e2e

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

hack/tree_status.sh

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

tools/Makefile

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

tools/go.mod

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

0 commit comments

Comments
 (0)