Skip to content

Commit 918f95c

Browse files
authored
Merge pull request #1 from go-openapi/copilot/copy-go-openapi-infrastructure
Add standard go-openapi monorepo infrastructure
2 parents 7d5044e + 138f7ae commit 918f95c

14 files changed

Lines changed: 466 additions & 1 deletion

.github/dependabot.yaml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
day: "friday"
8+
open-pull-requests-limit: 2 # <- default is 5
9+
allow:
10+
- dependency-type: all
11+
groups: # <- group all github actions updates in a single PR
12+
# 1. development-dependencies are auto-merged
13+
development-dependencies:
14+
patterns:
15+
- '*'
16+
assignees:
17+
- fredbi
18+
19+
- package-ecosystem: "gomod"
20+
# We define 4 groups of dependencies to regroup update pull requests:
21+
# - development (e.g. test dependencies)
22+
# - go-openapi updates
23+
# - golang.org (e.g. golang.org/x/... packages)
24+
# - other dependencies (direct or indirect)
25+
#
26+
# * All groups are checked once a week and each produce at most 1 PR.
27+
# * All dependabot PRs are auto-approved
28+
#
29+
# Auto-merging policy, when requirements are met:
30+
# 1. development-dependencies are auto-merged
31+
# 2. golang.org-dependencies are auto-merged
32+
# 3. go-openapi patch updates are auto-merged. Minor/major version updates require a manual merge.
33+
# 4. other dependencies require a manual merge
34+
directories:
35+
- "**/*"
36+
schedule:
37+
interval: "weekly"
38+
day: "friday"
39+
open-pull-requests-limit: 4
40+
groups:
41+
development-dependencies:
42+
patterns:
43+
- "github.com/stretchr/testify"
44+
- "github.com/go-openapi/testify"
45+
46+
golang-org-dependencies:
47+
patterns:
48+
- "golang.org/*"
49+
50+
go-openapi-dependencies:
51+
patterns:
52+
- "github.com/go-openapi/*"
53+
exclude-patterns:
54+
- "github.com/go-openapi/testify"
55+
56+
other-dependencies:
57+
exclude-patterns:
58+
- "github.com/go-openapi/*"
59+
- "github.com/stretchr/testify"
60+
- "github.com/go-openapi/testify"
61+
- "golang.org/*"
62+
allow:
63+
- dependency-type: all
64+
assignees:
65+
- fredbi

.github/workflows/auto-merge.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Dependabot auto-merge
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request:
8+
9+
jobs:
10+
dependabot:
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
uses: go-openapi/ci-workflows/.github/workflows/auto-merge.yml@7a1bb6c4f078ac1a3258db1ae91c37a9d29eee2a # v0.3.4
15+
secrets: inherit

.github/workflows/bump-release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Bump Release
2+
3+
permissions:
4+
contents: read
5+
6+
7+
on:
8+
workflow_dispatch:
9+
inputs:
10+
bump-type:
11+
description: Type of bump (patch, minor, major)
12+
type: choice
13+
options:
14+
- patch
15+
- minor
16+
- major
17+
default: patch
18+
required: false
19+
tag-message-title:
20+
description: Tag message title to prepend to the release notes
21+
required: false
22+
type: string
23+
tag-message-body:
24+
description: |
25+
Tag message body to prepend to the release notes.
26+
(use "|" to replace end of line).
27+
required: false
28+
type: string
29+
30+
jobs:
31+
bump-release:
32+
permissions:
33+
contents: write
34+
pull-requests: write
35+
uses: go-openapi/ci-workflows/.github/workflows/bump-release-monorepo.yml@7a1bb6c4f078ac1a3258db1ae91c37a9d29eee2a # v0.3.4
36+
with:
37+
bump-type: ${{ inputs.bump-type }}
38+
tag-message-title: ${{ inputs.tag-message-title }}
39+
tag-message-body: ${{ inputs.tag-message-body }}
40+
secrets: inherit

.github/workflows/codeql.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
paths-ignore: # remove this clause if CodeQL is a required check
9+
- '**/*.md'
10+
schedule:
11+
- cron: '39 19 * * 5'
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
codeql:
18+
permissions:
19+
contents: read
20+
security-events: write
21+
uses: go-openapi/ci-workflows/.github/workflows/codeql.yml@7a1bb6c4f078ac1a3258db1ae91c37a9d29eee2a # v0.3.4
22+
secrets: inherit

.github/workflows/contributors.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Contributors
2+
3+
on:
4+
schedule:
5+
- cron: '18 4 * * 6'
6+
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
contributors:
14+
permissions:
15+
pull-requests: write
16+
contents: write
17+
uses: go-openapi/ci-workflows/.github/workflows/contributors.yml@7a1bb6c4f078ac1a3258db1ae91c37a9d29eee2a # v0.3.4
18+
secrets: inherit

.github/workflows/go-test.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: go test
2+
3+
permissions:
4+
pull-requests: read
5+
contents: read
6+
7+
on:
8+
push:
9+
branches:
10+
- master
11+
12+
pull_request:
13+
14+
jobs:
15+
test:
16+
uses: go-openapi/ci-workflows/.github/workflows/go-test-monorepo.yml@7a1bb6c4f078ac1a3258db1ae91c37a9d29eee2a # v0.3.4
17+
secrets: inherit
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Monitor bot PRs
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '18 6 * * *'
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
monitor-pr:
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
statuses: read
17+
uses: go-openapi/ci-workflows/.github/workflows/monitor-bot-pr.yml@cd9849915b4f8b6ceeeaf24e02e8f8e24202c8f6 # v0.3.3
18+
secrets: inherit

.github/workflows/scanner.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Vulnerability scans
2+
3+
on:
4+
branch_protection_rule:
5+
push:
6+
branches: ["master"]
7+
schedule:
8+
- cron: "18 4 * * 3"
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
scanners:
15+
permissions:
16+
contents: read
17+
security-events: write
18+
uses: go-openapi/ci-workflows/.github/workflows/scanner.yml@7a1bb6c4f078ac1a3258db1ae91c37a9d29eee2a # v0.3.4
19+
secrets: inherit

.github/workflows/tag-release.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Release on tag
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
tags:
9+
- v[0-9]+*
10+
11+
jobs:
12+
gh-release:
13+
name: Create release
14+
permissions:
15+
contents: write
16+
uses: go-openapi/ci-workflows/.github/workflows/release.yml@7a1bb6c4f078ac1a3258db1ae91c37a9d29eee2a # v0.3.4
17+
with:
18+
tag: ${{ github.ref_name }}
19+
is-monorepo: true
20+
secrets: inherit

.golangci.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
version: "2"
2+
linters:
3+
default: all
4+
disable:
5+
- cyclop
6+
- depguard
7+
- errchkjson
8+
- errorlint
9+
- exhaustruct
10+
- forcetypeassert
11+
- funlen
12+
- gochecknoglobals
13+
- gochecknoinits
14+
- gocognit
15+
- godot
16+
- godox
17+
- gomoddirectives
18+
- gosmopolitan
19+
- inamedparam
20+
- intrange
21+
- ireturn
22+
- lll
23+
- musttag
24+
- modernize
25+
- nestif
26+
- nlreturn
27+
- nonamedreturns
28+
- noinlineerr
29+
- paralleltest
30+
- recvcheck
31+
- testpackage
32+
- thelper
33+
- tagliatelle
34+
- tparallel
35+
- unparam
36+
- varnamelen
37+
- whitespace
38+
- wrapcheck
39+
- wsl
40+
- wsl_v5
41+
settings:
42+
dupl:
43+
threshold: 200
44+
goconst:
45+
min-len: 2
46+
min-occurrences: 3
47+
gocyclo:
48+
min-complexity: 45
49+
exclusions:
50+
generated: lax
51+
presets:
52+
- comments
53+
- common-false-positives
54+
- legacy
55+
- std-error-handling
56+
paths:
57+
- third_party$
58+
- builtin$
59+
- examples$
60+
formatters:
61+
enable:
62+
- gofmt
63+
- goimports
64+
exclusions:
65+
generated: lax
66+
paths:
67+
- third_party$
68+
- builtin$
69+
- examples$
70+
issues:
71+
# Maximum issues count per one linter.
72+
# Set to 0 to disable.
73+
# Default: 50
74+
max-issues-per-linter: 0
75+
# Maximum count of issues with the same text.
76+
# Set to 0 to disable.
77+
# Default: 3
78+
max-same-issues: 0

0 commit comments

Comments
 (0)