Skip to content

Commit e02120f

Browse files
committed
feat: add Renovate configuration testing infrastructure
- Add test script to validate regex patterns against spec files - Create GitHub Actions workflow for automated validation - Test both config syntax and regex pattern matching - Use Node.js 22 for modern compatibility - Add Node.js ignores to .gitignore - Include package-lock.json for reproducible CI builds The workflow runs on: - Push/PR changes to renovate.json - Changes to spec files - Manual workflow dispatch This ensures our custom Renovate managers correctly detect package versions in npx/, uvx/, and go/ directories.
1 parent 52cd035 commit e02120f

5 files changed

Lines changed: 833 additions & 1 deletion

File tree

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Renovate Configuration Validation
2+
3+
on:
4+
push:
5+
paths:
6+
- 'renovate.json'
7+
- '.github/workflows/renovate-validation.yml'
8+
- 'test/renovate/**'
9+
- 'npx/**/spec.yaml'
10+
- 'npx/**/spec.yml'
11+
- 'uvx/**/spec.yaml'
12+
- 'uvx/**/spec.yml'
13+
- 'go/**/spec.yaml'
14+
- 'go/**/spec.yml'
15+
pull_request:
16+
paths:
17+
- 'renovate.json'
18+
- '.github/workflows/renovate-validation.yml'
19+
- 'test/renovate/**'
20+
- 'npx/**/spec.yaml'
21+
- 'npx/**/spec.yml'
22+
- 'uvx/**/spec.yaml'
23+
- 'uvx/**/spec.yml'
24+
- 'go/**/spec.yaml'
25+
- 'go/**/spec.yml'
26+
workflow_dispatch:
27+
28+
jobs:
29+
validate-config:
30+
name: Validate Renovate Configuration
31+
runs-on: ubuntu-latest
32+
33+
steps:
34+
- name: Checkout repository
35+
uses: actions/checkout@v4
36+
37+
- name: Setup Node.js
38+
uses: actions/setup-node@v4
39+
with:
40+
node-version: '22'
41+
cache: 'npm'
42+
cache-dependency-path: 'test/renovate/package-lock.json'
43+
44+
- name: Install dependencies
45+
working-directory: test/renovate
46+
run: npm ci || npm install
47+
48+
- name: Validate Renovate config syntax
49+
run: npx --yes --package renovate -- renovate-config-validator
50+
51+
- name: Test regex patterns
52+
working-directory: test/renovate
53+
run: npm test
54+
55+
- name: Check for deprecated config
56+
run: |
57+
npx --yes --package renovate -- renovate-config-validator --strict || {
58+
echo "::warning::Configuration uses deprecated options. Consider migrating."
59+
exit 0
60+
}
61+
62+
test-dry-run:
63+
name: Test Renovate Dry Run
64+
runs-on: ubuntu-latest
65+
if: github.event_name == 'pull_request'
66+
67+
steps:
68+
- name: Checkout repository
69+
uses: actions/checkout@v4
70+
71+
- name: Setup Node.js
72+
uses: actions/setup-node@v4
73+
with:
74+
node-version: '22'
75+
76+
- name: Dry run Renovate
77+
env:
78+
LOG_LEVEL: debug
79+
RENOVATE_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
run: |
81+
npx --yes --package renovate -- renovate \
82+
--platform=github \
83+
--token="${RENOVATE_TOKEN}" \
84+
--dry-run=full \
85+
--print-config \
86+
--autodiscover=false \
87+
${{ github.repository }} || {
88+
echo "::warning::Dry run failed. This might be due to missing permissions or configuration issues."
89+
exit 0
90+
}

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,10 @@ Thumbs.db
3737

3838
# Environment files
3939
.env
40-
.env.local
40+
.env.local
41+
42+
# Node.js dependencies
43+
node_modules/
44+
npm-debug.log*
45+
yarn-debug.log*
46+
yarn-error.log*

0 commit comments

Comments
 (0)