Skip to content

Commit 55ff2dc

Browse files
authored
Merge pull request #2 from kcp-dev/add-prow
✨ add prowjobs
2 parents d003438 + 0e3a1fd commit 55ff2dc

File tree

4 files changed

+114
-9
lines changed

4 files changed

+114
-9
lines changed

.golangci.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,19 @@
1414

1515
run:
1616
modules-download-mode: readonly
17-
deadline: 20m
18-
skip-files:
19-
- zz_generated.*.go
17+
timeout: 20m
2018

2119
linters:
2220
enable:
2321
- asciicheck
2422
- bidichk
2523
- bodyclose
24+
- copyloopvar
2625
- depguard
2726
- durationcheck
2827
- errcheck
2928
- errname
3029
- errorlint
31-
- exportloopref
3230
- goconst
3331
- gocritic
3432
- gocyclo
@@ -51,10 +49,14 @@ linters:
5149
- wastedassign
5250
- whitespace
5351
disable-all: true
52+
5453
issues:
5554
# defaults to 3, which often needlessly hides issues and forces
5655
# to re-run the linter across the entire repo many times
57-
max-same-issues: 50
56+
max-same-issues: 0
57+
58+
exclude-files:
59+
- zz_generated.*.go
5860

5961
# NOTE: Do not use commas in the exclude patterns, or else the regex will be
6062
# split and you will be sad: https://github.com/golangci/golangci-lint/issues/665

.prow.yaml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Copyright 2025 The KCP Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
presubmits:
16+
- name: pull-api-syncagent-verify
17+
always_run: true
18+
decorate: true
19+
clone_uri: "https://github.com/kcp-dev/api-syncagent"
20+
labels:
21+
preset-goproxy: "true"
22+
spec:
23+
containers:
24+
- image: ghcr.io/kcp-dev/infra/build:1.23.4-3
25+
command:
26+
- hack/ci/verify.sh
27+
resources:
28+
requests:
29+
memory: 1Gi
30+
cpu: 1
31+
32+
- name: pull-api-syncagent-lint
33+
always_run: true
34+
decorate: true
35+
clone_uri: "https://github.com/kcp-dev/api-syncagent"
36+
labels:
37+
preset-goproxy: "true"
38+
spec:
39+
containers:
40+
- image: ghcr.io/kcp-dev/infra/build:1.23.4-3
41+
command:
42+
- make
43+
- lint
44+
resources:
45+
requests:
46+
memory: 4Gi
47+
cpu: 2
48+
49+
- name: pull-api-syncagent-build-image
50+
always_run: true
51+
decorate: true
52+
clone_uri: "https://github.com/kcp-dev/api-syncagent"
53+
labels:
54+
preset-goproxy: "true"
55+
spec:
56+
containers:
57+
- image: quay.io/containers/buildah:v1.30.0
58+
command:
59+
- hack/ci/build-image.sh
60+
env:
61+
- name: DRY_RUN
62+
value: '1'
63+
# docker-in-docker needs privileged mode
64+
securityContext:
65+
privileged: true
66+
resources:
67+
requests:
68+
memory: 1Gi
69+
cpu: 1
70+
71+
- name: pull-api-syncagent-test
72+
always_run: true
73+
decorate: true
74+
clone_uri: "https://github.com/kcp-dev/api-syncagent"
75+
labels:
76+
preset-goproxy: "true"
77+
spec:
78+
containers:
79+
- image: ghcr.io/kcp-dev/infra/build:1.23.4-3
80+
command:
81+
- make
82+
- test
83+
env:
84+
- name: USE_GOTESTSUM
85+
value: '1'
86+
resources:
87+
requests:
88+
memory: 4Gi
89+
cpu: 2

hack/ci/verify.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ cd $(dirname $0)/../..
2020
source hack/lib.sh
2121

2222
EXIT_CODE=0
23+
SUMMARY=
2324

2425
try() {
2526
local title="$1"
2627
shift
2728

2829
heading "$title"
29-
echo -e "$@\n"
30+
echo
3031

3132
start_time=$(date +%s)
3233

@@ -38,13 +39,18 @@ try() {
3839
elapsed_time=$(($(date +%s) - $start_time))
3940
TEST_NAME="$title" write_junit $exitCode "$elapsed_time"
4041

42+
local status
4143
if [[ $exitCode -eq 0 ]]; then
4244
echo -e "\n[${elapsed_time}s] SUCCESS :)"
45+
status=OK
4346
else
4447
echo -e "\n[${elapsed_time}s] FAILED."
48+
status=FAIL
4549
EXIT_CODE=1
4650
fi
4751

52+
SUMMARY="$SUMMARY\n$(printf "%-35s %s" "$title" "$status")"
53+
4854
git reset --hard --quiet
4955
git clean --force
5056

@@ -87,4 +93,12 @@ try "Verify Go imports" verify_imports
8793
try "Verify license compatibility" ./hack/verify-licenses.sh
8894
try "Verify boilerplate" ./hack/verify-boilerplate.sh
8995

96+
echo
97+
echo "SUMMARY"
98+
echo "======="
99+
echo
100+
echo "Check Result"
101+
echo -n "------------------------------------------"
102+
echo -e "$SUMMARY"
103+
90104
exit $EXIT_CODE

hack/download-tool.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ fi
4444
mkdir -p tmp
4545
cd tmp
4646

47-
echo "Downloading $BINARY" >&2
48-
curl --fail -LO "$URL"
47+
echo "Downloading $BINARY version $VERSION" >&2
48+
curl --fail --silent -LO "$URL"
4949
archive="$(ls)"
5050

5151
UNCOMPRESSED=${UNCOMPRESSED:-false}
@@ -71,4 +71,4 @@ fi
7171
rm -rf tmp
7272
echo "$VERSION" > "$versionFile"
7373

74-
echo "Installed $BINARY version $VERSION." >&2
74+
echo "Installed at _tools/$BINARY." >&2

0 commit comments

Comments
 (0)