Skip to content

Commit f98b2f6

Browse files
authored
Merge pull request #18 from opsmill/pmc-20251228-updates
chore: add comprehensive CI pipeline with file-based filtering
2 parents 95cb727 + 0daac0a commit f98b2f6

18 files changed

Lines changed: 770 additions & 58 deletions

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Default owners for everything in the repo
2+
3+
* @opsmill/cloud

.github/dependabot.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
version: 2
3+
updates:
4+
- package-ecosystem: gomod
5+
directory: /
6+
schedule:
7+
interval: weekly
8+
day: monday
9+
open-pull-requests-limit: 10
10+
labels:
11+
- dependencies
12+
- go
13+
commit-message:
14+
prefix: "chore(deps)"
15+
16+
- package-ecosystem: github-actions
17+
directory: /
18+
schedule:
19+
interval: weekly
20+
day: monday
21+
open-pull-requests-limit: 5
22+
labels:
23+
- dependencies
24+
- ci
25+
commit-message:
26+
prefix: "chore(ci)"
27+
28+
- package-ecosystem: npm
29+
directory: /docs
30+
schedule:
31+
interval: weekly
32+
day: monday
33+
open-pull-requests-limit: 10
34+
labels:
35+
- dependencies
36+
- documentation
37+
commit-message:
38+
prefix: "chore(docs)"

.github/file-filters.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
go: &go
3+
- "**/*.go"
4+
- "go.mod"
5+
- "go.sum"
6+
- "Makefile"
7+
8+
go_all:
9+
- *go
10+
11+
yaml: &yaml
12+
- "**/*.yml"
13+
- "**/*.yaml"
14+
- "!docs/node_modules/**"
15+
16+
yaml_all:
17+
- *yaml
18+
19+
markdown: &markdown
20+
- "**/*.md"
21+
- "**/*.mdx"
22+
- "!docs/node_modules/**"
23+
24+
markdown_all:
25+
- *markdown
26+
27+
documentation: &documentation
28+
- "docs/**"
29+
- "!docs/node_modules/**"
30+
- ".vale.ini"
31+
- ".vale/**"
32+
33+
documentation_all:
34+
- *documentation

.github/labeler.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
# Pull Request Labeler Configuration
3+
# https://github.com/actions/labeler
4+
5+
documentation:
6+
- changed-files:
7+
- any-glob-to-any-file:
8+
- "docs/**"
9+
- "**/*.md"
10+
- "**/*.mdx"
11+
12+
go:
13+
- changed-files:
14+
- any-glob-to-any-file:
15+
- "**/*.go"
16+
- "go.mod"
17+
- "go.sum"
18+
19+
ci:
20+
- changed-files:
21+
- any-glob-to-any-file:
22+
- ".github/**"
23+
24+
backup:
25+
- changed-files:
26+
- any-glob-to-any-file:
27+
- "src/cmd/infrahub-backup/**"
28+
- "src/internal/app/backup.go"
29+
30+
taskmanager:
31+
- changed-files:
32+
- any-glob-to-any-file:
33+
- "src/cmd/infrahub-taskmanager/**"
34+
- "src/internal/app/taskmanager.go"

.github/labels.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
# Repository Labels Configuration
3+
# Managed by crazy-max/ghaction-github-labeler
4+
5+
- name: bug
6+
color: d73a4a
7+
description: Something isn't working
8+
9+
- name: documentation
10+
color: 0075ca
11+
description: Improvements or additions to documentation
12+
13+
- name: enhancement
14+
color: a2eeef
15+
description: New feature or request
16+
17+
- name: go
18+
color: 00ADD8
19+
description: Go code changes
20+
21+
- name: ci
22+
color: 6f42c1
23+
description: CI/CD related changes
24+
25+
- name: backup
26+
color: fbca04
27+
description: Backup tool changes
28+
29+
- name: taskmanager
30+
color: 5319e7
31+
description: Task manager tool changes
32+
33+
- name: dependencies
34+
color: 0366d6
35+
description: Dependency updates
36+
37+
- name: security
38+
color: ee0701
39+
description: Security related changes
40+
41+
- name: breaking-change
42+
color: b60205
43+
description: Breaking change requiring attention
44+
45+
- name: good first issue
46+
color: 7057ff
47+
description: Good for newcomers
48+
49+
- name: help wanted
50+
color: 008672
51+
description: Extra attention is needed
52+
53+
- name: wontfix
54+
color: ffffff
55+
description: This will not be worked on
56+
57+
- name: duplicate
58+
color: cfd3d7
59+
description: This issue or pull request already exists

.github/workflows/ci.yml

Lines changed: 109 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,51 @@
11
---
22
name: CI
3-
3+
# yamllint disable rule:truthy rule:line-length
44
on:
5+
pull_request:
56
push:
67
branches:
7-
- "main"
8-
pull_request:
8+
- main
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
permissions:
15+
contents: read
916

1017
jobs:
11-
lint:
18+
files-changed:
19+
name: Detect which files have changed
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 5
22+
outputs:
23+
documentation: ${{ steps.changes.outputs.documentation_all }}
24+
go: ${{ steps.changes.outputs.go_all }}
25+
yaml: ${{ steps.changes.outputs.yaml_all }}
26+
markdown: ${{ steps.changes.outputs.markdown_all }}
27+
steps:
28+
- uses: actions/checkout@v5
29+
- name: Check for file changes
30+
uses: opsmill/paths-filter@v3.0.2
31+
id: changes
32+
with:
33+
token: ${{ github.token }}
34+
filters: .github/file-filters.yml
35+
36+
go-lint:
37+
if: needs.files-changed.outputs.go == 'true'
38+
needs: ["files-changed"]
1239
runs-on: ubuntu-24.04
40+
timeout-minutes: 5
1341
steps:
14-
- name: "Check out repository code"
42+
- name: Check out repository code
1543
uses: actions/checkout@v5
1644

1745
- name: Set up Go
1846
uses: actions/setup-go@v6
1947
with:
20-
go-version: "1.25"
48+
go-version: "1.23"
2149

2250
- name: Build watchdog
2351
run: make build-watchdog
@@ -28,17 +56,91 @@ jobs:
2856
version: v2.1
2957

3058
test:
59+
if: needs.files-changed.outputs.go == 'true'
60+
needs: ["files-changed", "go-lint"]
3161
runs-on: ubuntu-24.04
62+
timeout-minutes: 10
3263
steps:
3364
- uses: actions/checkout@v5
3465

3566
- name: Set up Go
3667
uses: actions/setup-go@v6
3768
with:
38-
go-version: "1.25"
69+
go-version: "1.23"
3970

4071
- name: Build watchdog
4172
run: make build-watchdog
4273

4374
- name: Run tests
4475
run: make test
76+
77+
yaml-lint:
78+
if: needs.files-changed.outputs.yaml == 'true'
79+
needs: ["files-changed"]
80+
runs-on: ubuntu-latest
81+
timeout-minutes: 5
82+
steps:
83+
- uses: actions/checkout@v5
84+
- name: Install yamllint
85+
run: pip install yamllint
86+
- name: Run yamllint
87+
run: yamllint -s .
88+
89+
markdown-lint:
90+
if: needs.files-changed.outputs.markdown == 'true'
91+
needs: ["files-changed"]
92+
runs-on: ubuntu-latest
93+
timeout-minutes: 5
94+
steps:
95+
- uses: actions/checkout@v5
96+
- uses: actions/setup-node@v4
97+
with:
98+
node-version: 20
99+
- name: Install markdownlint-cli
100+
run: npm install -g markdownlint-cli
101+
- name: Run markdownlint
102+
run: markdownlint "**/*.md" --ignore node_modules --ignore docs/node_modules
103+
104+
validate-documentation-style:
105+
if: |
106+
always() && !cancelled() &&
107+
!contains(needs.*.result, 'failure') &&
108+
!contains(needs.*.result, 'cancelled') &&
109+
needs.files-changed.outputs.documentation == 'true'
110+
needs: ["files-changed", "yaml-lint", "markdown-lint"]
111+
runs-on: ubuntu-22.04
112+
timeout-minutes: 5
113+
env:
114+
VALE_VERSION: "3.13.0"
115+
steps:
116+
- uses: actions/checkout@v5
117+
- name: Download Vale
118+
run: |
119+
curl -sL "https://github.com/errata-ai/vale/releases/download/v${VALE_VERSION}/vale_${VALE_VERSION}_Linux_64-bit.tar.gz" -o vale.tar.gz
120+
tar -xzf vale.tar.gz
121+
- name: Validate documentation style
122+
run: ./vale $(find ./docs/docs -type f \( -name "*.mdx" -o -name "*.md" \))
123+
124+
documentation:
125+
defaults:
126+
run:
127+
working-directory: ./docs
128+
if: |
129+
always() && !cancelled() &&
130+
!contains(needs.*.result, 'failure') &&
131+
!contains(needs.*.result, 'cancelled') &&
132+
needs.files-changed.outputs.documentation == 'true'
133+
needs: ["files-changed", "yaml-lint", "markdown-lint"]
134+
runs-on: ubuntu-22.04
135+
timeout-minutes: 5
136+
steps:
137+
- uses: actions/checkout@v5
138+
- uses: actions/setup-node@v4
139+
with:
140+
node-version: 20
141+
cache: 'npm'
142+
cache-dependency-path: docs/package-lock.json
143+
- name: Install Node dependencies
144+
run: npm install
145+
- name: Build docs website
146+
run: npm run build

.github/workflows/release.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,24 @@ jobs:
1010
publish:
1111
runs-on: ubuntu-24.04
1212
steps:
13-
- name: "Check out repository code"
13+
- name: Check out repository code
1414
uses: actions/checkout@v5
1515

1616
- name: Set up Go
1717
uses: actions/setup-go@v6
1818
with:
19-
go-version: "1.25"
19+
go-version: "1.23"
2020

2121
- name: Build
2222
run: make build-all
2323

2424
- name: Upload
25+
env:
26+
S3_ACCESS_KEY: ${{ secrets.S3_BUCKET_ACCESS_KEY }}
27+
S3_SECRET_KEY: ${{ secrets.S3_BUCKET_SECRET_KEY }}
28+
S3_ENDPOINT: ${{ secrets.S3_BUCKET_ENDPOINT }}
29+
S3_BUCKET: ${{ secrets.S3_BUCKET_NAME }}
2530
run: |
26-
docker run -v ./bin:/build -e "MC_HOST_bucket=https://${{ secrets.S3_BUCKET_ACCESS_KEY }}:${{ secrets.S3_BUCKET_SECRET_KEY }}@${{ secrets.S3_BUCKET_ENDPOINT }}" minio/mc cp -r /build/ bucket/${{ secrets.S3_BUCKET_NAME }}/
31+
docker run -v ./bin:/build \
32+
-e "MC_HOST_bucket=https://${S3_ACCESS_KEY}:${S3_SECRET_KEY}@${S3_ENDPOINT}" \
33+
minio/mc cp -r /build/ bucket/${S3_BUCKET}/

.markdownlint.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
# Markdownlint configuration
3+
# https://github.com/DavidAnson/markdownlint
4+
5+
default: true
6+
7+
# MD013/line-length - Line length (disabled for readability in prose)
8+
MD013: false
9+
10+
# MD024/no-duplicate-heading - Multiple headings with the same content
11+
# Allow duplicate headings in different sections (e.g., tabs)
12+
MD024:
13+
siblings_only: true
14+
15+
# MD025/single-title - Multiple top-level headings
16+
# Prevent collisions with h1s and frontmatter titles
17+
MD025:
18+
front_matter_title: ""
19+
20+
# MD029/ol-prefix - Ordered list item prefix (disabled for manual numbering)
21+
MD029: false
22+
23+
# MD033/no-inline-html - Inline HTML (disabled for MDX React components)
24+
MD033: false
25+
26+
# MD060/table-column-style - Table column style (disabled for flexibility)
27+
MD060: false

0 commit comments

Comments
 (0)