Skip to content

Commit 446d3dc

Browse files
authored
fix: eirctl used (#40)
* fix: eirctl used Go bump to 1.24.4 * fix: remove comments * fix: remove deps in CI * fix: use eirctl exclusively
1 parent f185dd7 commit 446d3dc

File tree

6 files changed

+194
-138
lines changed

6 files changed

+194
-138
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ jobs:
4040
echo "VERSION -> $GITVERSION_SEMVER"
4141
test:
4242
runs-on: ubuntu-latest
43-
container:
44-
image: golang:1.24-bookworm
4543
needs: set-version
4644
env:
4745
SEMVER: ${{ needs.set-version.outputs.semVer }}
@@ -51,25 +49,18 @@ jobs:
5149
- uses: actions/checkout@v4
5250
with:
5351
fetch-depth: 1
54-
- name: Install Task
55-
uses: arduino/setup-task@v2
56-
with:
57-
version: 3.x
58-
repo-token: ${{ secrets.GITHUB_TOKEN }}
59-
60-
- name: install deps
61-
run: |
62-
apt update && apt install -y jq git unzip
63-
git config --global --add safe.directory "$GITHUB_WORKSPACE"
64-
git config user.email ${{ github.actor }}[email protected]
65-
git config user.name ${{ github.actor }}
52+
- name: Install Eirctl
53+
uses: ensono/actions/[email protected]
54+
with:
55+
version: 0.6.5
56+
isPrerelease: false
6657

6758
- name: Run Lint
6859
run: |
69-
task lint
60+
eirctl run pipeline lint
7061
- name: Run Tests
7162
run: |
72-
task coverage
63+
eirctl run pipeline test
7364
ls -alt .coverage/out
7465
ls -lat .coverage/report-junit.xml
7566
- name: Publish Junit style Test Report

.github/workflows/release.yml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ jobs:
4040

4141
release:
4242
runs-on: ubuntu-latest
43-
container:
44-
image: golang:1.24-bookworm
45-
env:
46-
FOO: Bar
4743
needs: set-version
4844
env:
4945
SEMVER: ${{ needs.set-version.outputs.semVer }}
@@ -52,24 +48,23 @@ jobs:
5248
with:
5349
fetch-depth: 1
5450

55-
- name: Install Task
56-
uses: arduino/setup-task@v2
57-
with:
58-
version: 3.x
59-
repo-token: ${{ secrets.GITHUB_TOKEN }}
51+
- name: Install Eirctl
52+
uses: ensono/actions/[email protected]
53+
with:
54+
version: 0.6.5
55+
isPrerelease: false
6056

61-
- name: install deps
57+
- name: release library
6258
run: |
63-
apt-get update && apt-get install jq git -y
6459
git config --global --add safe.directory "$GITHUB_WORKSPACE"
6560
git config user.email ${{ github.actor }}[email protected]
6661
git config user.name ${{ github.actor }}
67-
- name: release library
68-
run: |
69-
task tag GIT_TAG=${SEMVER} REVISION=$GITHUB_SHA
62+
GIT_TAG=${SEMVER} REVISION=$GITHUB_SHA eirctl run tag
63+
7064
- name: build binary
7165
run: |
72-
task bin REVISION=$GITHUB_SHA GIT_TAG=${SEMVER}
66+
eirctl run pipeline build:bin --set VERSION=${SEMVER} --set REVISION=$GITHUB_SHA
67+
7368
- name: Release binary
7469
uses: softprops/action-gh-release@v2
7570
with:

eirctl.yaml

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/Ensono/eirctl/refs/heads/main/schemas/schema_v1.json
2+
3+
output: prefixed
4+
debug: false
5+
6+
contexts:
7+
go1x:
8+
container:
9+
name: golang:1.24.4-bookworm
10+
enable_dind: true
11+
enable_mount: true
12+
envfile:
13+
exclude:
14+
- GO
15+
- CXX
16+
- CGO
17+
18+
golint:
19+
container:
20+
name: golangci/golangci-lint:v2.1.5-alpine
21+
enable_dind: true
22+
enable_mount: true
23+
envfile:
24+
exclude:
25+
- GO
26+
- CXX
27+
- CGO
28+
- PATH
29+
- HOME
30+
31+
tasks:
32+
clean:
33+
context: go1x
34+
command:
35+
- rm -rf dist/*
36+
- rm -rf .coverage
37+
- mkdir -p dist .coverage
38+
39+
run:test:
40+
description: Runs the tests
41+
context: go1x
42+
command:
43+
- |
44+
go test ./... -v -buildvcs=false -mod=readonly -race -coverpkg=./... -coverprofile=.coverage/out | tee .coverage/unit
45+
46+
install:
47+
description: Install dependencies
48+
command: |
49+
go mod tidy
50+
51+
lint:vet:
52+
description: Runs lint and vet
53+
context: go1x
54+
command: |
55+
go vet
56+
57+
golint:
58+
# in CI it is run
59+
context: golint
60+
description: Runs the linter and go vet and other default static checks
61+
allow_failure: false
62+
command:
63+
# echo "lint ran with exit code: $?"
64+
# pwd && ls -lat
65+
- |
66+
golangci-lint run
67+
68+
vuln:check:
69+
context: go1x
70+
description: |
71+
Runs a vulnerability scan against the code base
72+
command:
73+
- |
74+
go install golang.org/x/vuln/cmd/govulncheck@latest
75+
govulncheck ./...
76+
77+
coverage:
78+
description: generate coverage
79+
context: go1x
80+
command:
81+
- |
82+
go install github.com/jstemmer/go-junit-report/v2@latest
83+
go install github.com/axw/gocov/gocov@latest
84+
go install github.com/AlekSi/gocov-xml@latest
85+
go-junit-report -in .coverage/unit > .coverage/report-junit.xml
86+
gocov convert .coverage/out | gocov-xml > .coverage/report-cobertura.xml
87+
88+
show:coverage:
89+
description: Opens the current coverage viewer for the the configmanager utility.
90+
command: go tool cover -html=.coverage/out
91+
92+
show_docs:
93+
description: |
94+
Opens a webview with godoc running
95+
Already filters the packages to this one and enables
96+
internal/private package documentation
97+
# go install golang.org/x/tools/cmd/godoc@latest
98+
command: |
99+
open http://localhost:6060/pkg/github.com/DevLabFoundry/configmanager/v2/?m=all
100+
godoc -notes "BUG|TODO" -play -http=:6060
101+
102+
build:binary:
103+
context: go1x
104+
description: |
105+
Generates binaries in a dist folder
106+
107+
Generates all the binaries for the configmanager utility.
108+
command:
109+
- |
110+
ldflags="-s -w -X \"github.com/DevLabFoundry/configmanager/v2/cmd/configmanager.Version={{.VERSION}}\" -X \"github.com/DevLabFoundry/configmanager/v2/cmd/configmanager.Revision={{.REVISION}}\" -extldflags -static"
111+
GOOS=${BUILD_GOOS} GOARCH=${BUILD_GOARCH} CGO_ENABLED=0 go build -mod=readonly -buildvcs=false -ldflags="$ldflags" \
112+
-o ./dist/configmanager-${GOOS}-${GOARCH}${BUILD_SUFFIX} ./cmd
113+
reset_context: true
114+
variations:
115+
- BUILD_GOOS: darwin
116+
BUILD_GOARCH: amd64
117+
BUILD_SUFFIX: ""
118+
- BUILD_GOOS: darwin
119+
BUILD_GOARCH: arm64
120+
BUILD_SUFFIX: ""
121+
- BUILD_GOOS: linux
122+
BUILD_GOARCH: amd64
123+
BUILD_SUFFIX: ""
124+
- BUILD_GOOS: linux
125+
BUILD_GOARCH: arm64
126+
BUILD_SUFFIX: ""
127+
- BUILD_GOOS: windows
128+
BUILD_GOARCH: amd64
129+
BUILD_SUFFIX: ".exe"
130+
- BUILD_GOOS: windows
131+
BUILD_GOARCH: arm64
132+
BUILD_SUFFIX: ".exe"
133+
- BUILD_GOOS: windows
134+
BUILD_GOARCH: "386"
135+
BUILD_SUFFIX: ".exe"
136+
required:
137+
args:
138+
- VERSION
139+
- REVISION
140+
141+
tag:
142+
description: |
143+
Usage `eirctl tag GIT_TAG=2111dsfsdfa REVISION=as2342432`
144+
145+
command: |
146+
git tag -a ${VERSION} -m "ci tag release" ${REVISION}
147+
git push origin ${VERSION}
148+
required:
149+
env:
150+
- VERSION
151+
- REVISION
152+
153+
pipelines:
154+
test:
155+
- task: clean
156+
- task: run:test
157+
depends_on: clean
158+
- task: coverage
159+
depends_on: run:test
160+
161+
lint:
162+
- task: lint:vet
163+
- task: vuln:check
164+
165+
show_coverage:
166+
- pipeline: test
167+
- task: show:coverage
168+
depends_on: test
169+
170+
build:bin:
171+
- task: clean
172+
- task: build:binary
173+
depends_on: clean
174+

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/DevLabFoundry/configmanager/v2
22

3-
go 1.24.3
3+
go 1.24.4
44

55
require (
66
cloud.google.com/go/secretmanager v1.14.7

sonar-project.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ sonar.tests=.
1212
sonar.test.inclusions=**/*_test.go
1313
sonar.test.exclusions=**/*_generated*.go,**/*_generated/**,**/vendor/**
1414

15-
sonar.sourceEncoding=UTF-8
15+
sonar.sourceEncoding=UTF-8
16+
sonar.qualitygate.wait=true

taskfile.yml

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

0 commit comments

Comments
 (0)