Skip to content

Commit 424ea72

Browse files
committed
Adjust project files and configuration
Initial pipeline, add gotools install action Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de>
1 parent a5d9f04 commit 424ea72

File tree

18 files changed

+281
-179
lines changed

18 files changed

+281
-179
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: Bug report
3-
about: Report a bug in the STACKIT pulumi provider
3+
about: Report a bug in the STACKIT Pulumi Provider
44
title: ''
55
labels: bug
66
assignees: ''
@@ -26,16 +26,17 @@ assignees: ''
2626

2727
## Actual behavior
2828

29-
*Please describe the current behavior of the STACKIT pulumi provider. Don't forget to add detailed information like error messages.*
29+
*Please describe the current behavior of the STACKIT Pulumi Provider. Don't forget to add detailed information like error messages.*
3030

3131
## Expected behavior
3232

33-
*Please describe the behavior which you would expect from the STACKIT pulumi provider in that case.*
33+
*Please describe the behavior which you would expect from the STACKIT Pulumi Provider in that case.*
3434

3535
## Environment
3636
- OS:
37-
- pulumi version (see `pulumi --version`): `vX.X.X`
38-
- Version of the STACKIT pulumi provider: `vX.X.X`
37+
- pulumi version (see `pulumi version`): `vX.X.X`
38+
- pulumictl version (see `pulumictl version`) `X.X.X`
39+
- Version of the STACKIT Pulumi Provider: `vX.X.X`
3940

4041
**Additional information**
4142

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: Feature request
3-
about: Suggest an idea for the STACKIT pulumi provider
3+
about: Suggest an idea for the STACKIT Pulumi Provider
44
title: ''
55
labels: enhancement
66
assignees: ''
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Install Go Tools
2+
description: "Install Go Tools for pipeline"
3+
inputs:
4+
go-version:
5+
description: "Go version to install"
6+
required: true
7+
runs:
8+
using: "composite"
9+
steps:
10+
- name: Install Go ${{ inputs.go-version }}
11+
uses: actions/setup-go@v5
12+
with:
13+
go-version: ${{ inputs.go-version }}
14+
- name: Install project tools and dependencies
15+
shell: bash
16+
run: make project-tools

.github/workflows/ci.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: CI Workflow
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
push:
7+
branches:
8+
- main
9+
10+
permissions:
11+
contents: write
12+
id-token: write
13+
14+
env:
15+
GO_VERSION: "1.24"
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
18+
jobs:
19+
main:
20+
name: CI
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Unshallow clone for tags
27+
run: git fetch --prune --unshallow --tags
28+
29+
- name: Install pulumictl
30+
uses: jaxxstorm/action-install-gh-release@6096f2a2bbfee498ced520b6922ac2c06e990ed2 # tag=v2.1.0
31+
with:
32+
repo: pulumi/pulumictl
33+
34+
- name: Install pulumi
35+
uses: pulumi/actions@v4
36+
37+
- name: Install Go Tools
38+
uses: ./.github/actions/gotools
39+
with:
40+
go-version: ${{ env.GO_VERSION }}
41+
42+
- name: Build sdks
43+
run: make build
44+
45+
- name: Lint
46+
run: make lint_provider
47+
48+
config:
49+
name: Check GoReleaser config
50+
if: github.event_name == 'pull_request'
51+
runs-on: ubuntu-latest
52+
steps:
53+
- name: Checkout
54+
uses: actions/checkout@v4
55+
56+
- name: Check GoReleaser
57+
uses: goreleaser/goreleaser-action@v6
58+
with:
59+
args: check

.github/workflows/release.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ jobs:
3232
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2
3333
- name: Unshallow clone for tags
3434
run: git fetch --prune --unshallow --tags
35-
- name: Install Go
36-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # tag=v5.5.0
37-
with:
38-
go-version: ${{matrix.goversion}}
3935
- name: Install pulumictl
4036
uses: jaxxstorm/action-install-gh-release@6096f2a2bbfee498ced520b6922ac2c06e990ed2 # tag=v2.1.0
4137
with:
4238
repo: pulumi/pulumictl
39+
- name: Install Go Tools
40+
uses: ./.github/actions/gotools
41+
with:
42+
go-version: ${{ matrix.goversion }}
4343
- name: Set PreRelease Version
4444
run: echo "GORELEASER_CURRENT_TAG=v$(pulumictl get version --language generic)" >> $GITHUB_ENV
4545
- uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
@@ -63,7 +63,7 @@ jobs:
6363
fail-fast: true
6464
matrix:
6565
goversion:
66-
- 1.22.x
66+
- 1.24.x
6767
publish_sdk:
6868
name: Publish SDKs
6969
runs-on: ubuntu-latest
@@ -73,16 +73,16 @@ jobs:
7373
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2
7474
- name: Unshallow clone for tags
7575
run: git fetch --prune --unshallow --tags
76-
- name: Install Go
77-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # tag=v5.5.0
78-
with:
79-
go-version: ${{ matrix.goversion }}
8076
- name: Install pulumictl
8177
uses: jaxxstorm/action-install-gh-release@6096f2a2bbfee498ced520b6922ac2c06e990ed2 # tag=v2.1.0
8278
with:
8379
repo: pulumi/pulumictl
8480
- name: Install Pulumi CLI
8581
uses: pulumi/action-install-pulumi-cli@b374ceb6168550de27c6eba92e01c1a774040e11 # tag=v2.0.0
82+
- name: Install Go Tools
83+
uses: ./.github/actions/gotools
84+
with:
85+
go-version: ${{ matrix.goversion }}
8686
- name: Setup Node
8787
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # tag=v4.4.0
8888
with:
@@ -132,7 +132,7 @@ jobs:
132132
dotnetversion:
133133
- 3.1.301
134134
goversion:
135-
- 1.22.x
135+
- 1.24.x
136136
language:
137137
- nodejs
138138
- python

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.idea
22
.code
3+
pulumi-stackit.sln
34
**/vendor/
45
.pulumi
56
**/bin/

.golangci.yml

Lines changed: 89 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,95 @@
1+
# This file contains all available configuration options
2+
# with their default values.
3+
4+
# options for analysis running
5+
run:
6+
# default concurrency is a available CPU number
7+
concurrency: 4
8+
9+
# timeout for analysis, e.g. 30s, 5m, default is 1m
10+
timeout: 5m
11+
linters-settings:
12+
goimports:
13+
# put imports beginning with prefix after 3rd-party packages;
14+
# it's a comma-separated list of prefixes
15+
local-prefixes: github.com/freiheit-com/nmww
16+
depguard:
17+
rules:
18+
main:
19+
list-mode: lax # Everything is allowed unless it is denied
20+
deny:
21+
- pkg: "github.com/stretchr/testify"
22+
desc: Do not use a testing framework
23+
misspell:
24+
# Correct spellings using locale preferences for US or UK.
25+
# Default is to use a neutral variety of English.
26+
# Setting locale to US will correct the British spelling of 'colour' to 'color'.
27+
locale: US
28+
golint:
29+
min-confidence: 0.8
30+
gosec:
31+
excludes:
32+
# Suppressions: (see https://github.com/securego/gosec#available-rules for details)
33+
- G104 # "Audit errors not checked" -> which we don't need and is a badly implemented version of errcheck
34+
- G102 # "Bind to all interfaces" -> since this is normal in k8s
35+
- G304 # "File path provided as taint input" -> too many false positives
36+
- G307 # "Deferring unsafe method "Close" on type "io.ReadCloser" -> false positive when calling defer resp.Body.Close()
37+
nakedret:
38+
max-func-lines: 0
39+
revive:
40+
ignore-generated-header: true
41+
severity: error
42+
# https://github.com/mgechev/revive
43+
rules:
44+
- name: errorf
45+
- name: context-as-argument
46+
- name: error-return
47+
- name: increment-decrement
48+
- name: indent-error-flow
49+
- name: superfluous-else
50+
- name: unused-parameter
51+
- name: unreachable-code
52+
- name: atomic
53+
- name: empty-lines
54+
- name: early-return
55+
gocritic:
56+
enabled-tags:
57+
- performance
58+
- style
59+
- experimental
60+
disabled-checks:
61+
- wrapperFunc
62+
- typeDefFirst
63+
- ifElseChain
64+
- dupImport # https://github.com/go-critic/go-critic/issues/845
165
linters:
266
enable:
3-
- deadcode
4-
- errcheck
5-
- goconst
6-
- gofmt
7-
- golint
8-
- gosec
67+
# https://golangci-lint.run/usage/linters/
68+
# default linters
69+
- gosimple
970
- govet
1071
- ineffassign
11-
- interfacer
12-
- lll
13-
- megacheck
72+
- staticcheck
73+
- typecheck
74+
- unused
75+
# additional linters
76+
- errorlint
77+
- gochecknoinits
78+
- gocritic
79+
- gofmt
80+
- goimports
81+
- gosec
1482
- misspell
1583
- nakedret
16-
- structcheck
17-
- unconvert
18-
- varcheck
19-
enable-all: false
20-
run:
21-
skip-files:
22-
- schema.go
23-
- pulumiManifest.go
24-
timeout: 20m
84+
- revive
85+
- depguard
86+
- bodyclose
87+
- sqlclosecheck
88+
- wastedassign
89+
- forcetypeassert
90+
- errcheck
91+
disable:
92+
- noctx # false positive: finds errors with http.NewRequest that dont make sense
93+
- unparam # false positives
94+
issues:
95+
exclude-use-default: false

.goreleaser.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ release:
7171
prerelease: auto
7272

7373
snapshot:
74-
name_template: '{{ .Tag }}-SNAPSHOT'
74+
version_template: '{{ .Tag }}-SNAPSHOT'

CODE-OF-CONDUCT.md

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

0 commit comments

Comments
 (0)