Skip to content

Commit 7f6df03

Browse files
committed
chore: set PKG_NAME environment variable
Set PKG_NAME environment variable. This allows to validate extensions. Signed-off-by: Noel Georgi <[email protected]>
1 parent a7ac3b0 commit 7f6df03

File tree

15 files changed

+291
-189
lines changed

15 files changed

+291
-189
lines changed

.github/workflows/ci.yaml

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2024-03-05T05:52:53Z by kres latest.
3+
# Generated on 2024-05-23T12:22:27Z by kres 2688b70.
44

55
name: default
66
concurrency:
@@ -29,27 +29,44 @@ jobs:
2929
- self-hosted
3030
- generic
3131
if: (!startsWith(github.head_ref, 'renovate/') && !startsWith(github.head_ref, 'dependabot/'))
32-
services:
33-
buildkitd:
34-
image: moby/buildkit:v0.12.5
35-
options: --privileged
36-
ports:
37-
- 1234:1234
38-
volumes:
39-
- /var/lib/buildkit/${{ github.repository }}:/var/lib/buildkit
40-
- /usr/etc/buildkit/buildkitd.toml:/etc/buildkit/buildkitd.toml
4132
steps:
33+
- name: gather-system-info
34+
id: system-info
35+
uses: kenchan0130/[email protected]
36+
continue-on-error: true
37+
- name: print-system-info
38+
run: |
39+
MEMORY_GB=$((${{ steps.system-info.outputs.totalmem }}/1024/1024/1024))
40+
41+
OUTPUTS=(
42+
"CPU Core: ${{ steps.system-info.outputs.cpu-core }}"
43+
"CPU Model: ${{ steps.system-info.outputs.cpu-model }}"
44+
"Hostname: ${{ steps.system-info.outputs.hostname }}"
45+
"NodeName: ${NODE_NAME}"
46+
"Kernel release: ${{ steps.system-info.outputs.kernel-release }}"
47+
"Kernel version: ${{ steps.system-info.outputs.kernel-version }}"
48+
"Name: ${{ steps.system-info.outputs.name }}"
49+
"Platform: ${{ steps.system-info.outputs.platform }}"
50+
"Release: ${{ steps.system-info.outputs.release }}"
51+
"Total memory: ${MEMORY_GB} GB"
52+
)
53+
54+
for OUTPUT in "${OUTPUTS[@]}";do
55+
echo "${OUTPUT}"
56+
done
57+
continue-on-error: true
4258
- name: checkout
4359
uses: actions/checkout@v4
4460
- name: Unshallow
4561
run: |
4662
git fetch --prune --unshallow
4763
- name: Set up Docker Buildx
64+
id: setup-buildx
4865
uses: docker/setup-buildx-action@v3
4966
with:
5067
driver: remote
51-
endpoint: tcp://localhost:1234
52-
timeout-minutes: 1
68+
endpoint: tcp://buildkit-amd64.ci.svc.cluster.local:1234
69+
timeout-minutes: 10
5370
- name: base
5471
run: |
5572
make base
@@ -60,8 +77,11 @@ jobs:
6077
run: |
6178
make unit-tests-race
6279
- name: coverage
63-
run: |
64-
make coverage
80+
uses: codecov/codecov-action@v4
81+
with:
82+
files: _out/coverage-unit-tests.txt
83+
token: ${{ secrets.CODECOV_TOKEN }}
84+
timeout-minutes: 3
6585
- name: bldr
6686
run: |
6787
make bldr

.golangci.yml

Lines changed: 32 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2024-03-05T05:52:53Z by kres latest.
3+
# Generated on 2024-05-23T12:22:27Z by kres 2688b70.
44

55
# options for analysis running
66
run:
77
timeout: 10m
88
issues-exit-code: 1
99
tests: true
10-
build-tags: []
11-
skip-dirs: []
12-
skip-dirs-use-default: true
13-
skip-files: []
10+
build-tags: [ ]
1411
modules-download-mode: readonly
1512

1613
# output configuration options
1714
output:
18-
format: colored-line-number
15+
formats:
16+
- format: colored-line-number
17+
path: stdout
1918
print-issued-lines: true
2019
print-linter-name: true
2120
uniq-by-line: true
@@ -32,54 +31,35 @@ linters-settings:
3231
check-blank: true
3332
exhaustive:
3433
default-signifies-exhaustive: false
35-
funlen:
36-
lines: 60
37-
statements: 40
3834
gci:
39-
local-prefixes: github.com/siderolabs/bldr/
35+
sections:
36+
- standard # Standard section: captures all standard packages.
37+
- default # Default section: contains all imports that could not be matched to another section type.
38+
- localmodule # Imports from the same module.
4039
gocognit:
4140
min-complexity: 30
42-
ireturn:
43-
allow:
44-
- anon
45-
- error
46-
- empty
47-
- stdlib
48-
- github.com\/talos-systems\/kres\/internal\/dag.Node
4941
nestif:
5042
min-complexity: 5
5143
goconst:
5244
min-len: 3
5345
min-occurrences: 3
5446
gocritic:
55-
disabled-checks: []
47+
disabled-checks: [ ]
5648
gocyclo:
5749
min-complexity: 20
5850
godot:
59-
check-all: false
60-
godox:
61-
keywords: # default keywords are TODO, BUG, and FIXME, these can be overwritten by this setting
62-
- NOTE
63-
- OPTIMIZE # marks code that should be optimized before merging
64-
- HACK # marks hack-arounds that should be removed before merging
51+
scope: declarations
6552
gofmt:
6653
simplify: true
67-
goimports:
68-
local-prefixes: github.com/siderolabs/bldr/
69-
golint:
70-
min-confidence: 0.8
71-
gomnd:
72-
settings: {}
73-
gomodguard: {}
54+
gomodguard: { }
7455
govet:
75-
check-shadowing: true
7656
enable-all: true
7757
lll:
7858
line-length: 200
7959
tab-width: 4
8060
misspell:
8161
locale: US
82-
ignore-words: []
62+
ignore-words: [ ]
8363
nakedret:
8464
max-func-lines: 30
8565
prealloc:
@@ -88,16 +68,15 @@ linters-settings:
8868
for-loops: false # Report preallocation suggestions on for loops, false by default
8969
nolintlint:
9070
allow-unused: false
91-
allow-leading-space: false
92-
allow-no-explanation: []
71+
allow-no-explanation: [ ]
9372
require-explanation: false
9473
require-specific: true
95-
rowserrcheck: {}
96-
testpackage: {}
74+
rowserrcheck: { }
75+
testpackage: { }
9776
unparam:
9877
check-exported: false
9978
unused:
100-
check-exported: false
79+
local-variables-are-used: false
10180
whitespace:
10281
multi-if: false # Enforces newlines (or comments) after every multi-line if statement
10382
multi-func: false # Enforces newlines (or comments) after every multi-line function signature
@@ -113,8 +92,8 @@ linters-settings:
11392
gofumpt:
11493
extra-rules: false
11594
cyclop:
116-
# the maximal code complexity to report
117-
max-complexity: 20
95+
# the maximal code complexity to report
96+
max-complexity: 20
11897
# depguard:
11998
# Main:
12099
# deny:
@@ -125,48 +104,50 @@ linters:
125104
disable-all: false
126105
fast: false
127106
disable:
128-
- exhaustruct
129107
- exhaustivestruct
108+
- exhaustruct
109+
- err113
130110
- forbidigo
131111
- funlen
132-
- gas
133112
- gochecknoglobals
134113
- gochecknoinits
135114
- godox
136-
- goerr113
137115
- gomnd
138116
- gomoddirectives
117+
- gosec
118+
- inamedparam
139119
- ireturn
120+
- mnd
140121
- nestif
141122
- nonamedreturns
142123
- nosnakecase
143124
- paralleltest
125+
- tagalign
144126
- tagliatelle
145127
- thelper
146128
- typecheck
147129
- varnamelen
148130
- wrapcheck
149131
- depguard # Disabled because starting with golangci-lint 1.53.0 it doesn't allow denylist alone anymore
150-
- tagalign
151-
- inamedparam
152132
- testifylint # complains about our assert recorder and has a number of false positives for assert.Greater(t, thing, 1)
153133
- protogetter # complains about us using Value field on typed spec, instead of GetValue which has a different signature
154134
- perfsprint # complains about us using fmt.Sprintf in non-performance critical code, updating just kres took too long
155135
# abandoned linters for which golangci shows the warning that the repo is archived by the owner
136+
- deadcode
137+
- golint
138+
- ifshort
156139
- interfacer
157140
- maligned
158-
- golint
159141
- scopelint
160-
- varcheck
161-
- deadcode
162142
- structcheck
163-
- ifshort
143+
- varcheck
164144
# disabled as it seems to be broken - goes into imported libraries and reports issues there
165145
- musttag
146+
- goimports # same as gci
166147

167148
issues:
168-
exclude: []
169-
exclude-rules: []
149+
exclude: [ ]
150+
exclude-rules: [ ]
170151
exclude-use-default: false
171152
exclude-case-sensitive: false
172153
max-issues-per-linter: 10

.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"gopls": {
3+
"build.buildFlags": [
4+
"-tags=integration",
5+
]
6+
}
7+
}

Dockerfile

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
# syntax = docker/dockerfile-upstream:1.7.0-labs
1+
# syntax = docker/dockerfile-upstream:1.7.1-labs
22

33
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
44
#
5-
# Generated on 2024-03-06T10:32:46Z by kres latest.
5+
# Generated on 2024-05-23T12:22:27Z by kres 2688b70.
66

77
ARG TOOLCHAIN
88

9-
FROM ghcr.io/siderolabs/ca-certificates:v1.6.0 AS image-ca-certificates
9+
FROM ghcr.io/siderolabs/ca-certificates:v1.7.0 AS image-ca-certificates
1010

11-
FROM ghcr.io/siderolabs/fhs:v1.6.0 AS image-fhs
11+
FROM ghcr.io/siderolabs/fhs:v1.7.0 AS image-fhs
1212

1313
# runs markdownlint
14-
FROM docker.io/node:21.6.2-alpine3.19 AS lint-markdown
14+
FROM docker.io/node:22.2.0-alpine3.19 AS lint-markdown
1515
WORKDIR /src
16-
RUN npm i -g markdownlint-cli@0.39.0
16+
RUN npm i -g markdownlint-cli@0.40.0
1717
1818
COPY .markdownlint.json .
1919
COPY ./CHANGELOG.md ./CHANGELOG.md
2020
COPY ./README.md ./README.md
2121
RUN markdownlint --ignore "CHANGELOG.md" --ignore "**/node_modules/**" --ignore '**/hack/chglog/**' --rules node_modules/sentences-per-line/index.js .
2222

2323
# base toolchain image
24-
FROM ${TOOLCHAIN} AS toolchain
24+
FROM --platform=${BUILDPLATFORM} ${TOOLCHAIN} AS toolchain
2525
RUN apk --update --no-cache add bash curl build-base protoc protobuf-dev
2626

2727
# build tools
@@ -42,9 +42,6 @@ RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/g
4242
&& mv /go/bin/golangci-lint /bin/golangci-lint
4343
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg go install golang.org/x/vuln/cmd/govulncheck@latest \
4444
&& mv /go/bin/govulncheck /bin/govulncheck
45-
ARG GOIMPORTS_VERSION
46-
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg go install golang.org/x/tools/cmd/goimports@${GOIMPORTS_VERSION} \
47-
&& mv /go/bin/goimports /bin/goimports
4845
ARG GOFUMPT_VERSION
4946
RUN go install mvdan.cc/gofumpt@${GOFUMPT_VERSION} \
5047
&& mv /go/bin/gofumpt /bin/gofumpt
@@ -81,15 +78,12 @@ RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/g
8178
FROM base AS lint-gofumpt
8279
RUN FILES="$(gofumpt -l .)" && test -z "${FILES}" || (echo -e "Source code is not formatted with 'gofumpt -w .':\n${FILES}"; exit 1)
8380

84-
# runs goimports
85-
FROM base AS lint-goimports
86-
RUN FILES="$(goimports -l -local github.com/siderolabs/bldr/ .)" && test -z "${FILES}" || (echo -e "Source code is not formatted with 'goimports -w -local github.com/siderolabs/bldr/ .':\n${FILES}"; exit 1)
87-
8881
# runs golangci-lint
8982
FROM base AS lint-golangci-lint
9083
WORKDIR /src
9184
COPY .golangci.yml .
9285
ENV GOGC 50
86+
RUN golangci-lint config verify --config .golangci.yml
9387
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/root/.cache/golangci-lint --mount=type=cache,target=/go/pkg golangci-lint run --config .golangci.yml
9488

9589
# runs govulncheck

0 commit comments

Comments
 (0)