chore(ci): add renovate validation workflow (#168)

This commit is contained in:
William Boman 2023-06-01 20:27:55 +02:00 committed by GitHub
parent bec4974f55
commit 4dbcf181e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 71 additions and 2 deletions

View file

@ -25,7 +25,7 @@ jobs:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v3
with:
fetch-depth: 0

View file

@ -1,10 +1,33 @@
---
name: Test docker containers
on:
pull_request:
jobs:
diff:
name: Check if Dockerfile changed
runs-on: ubuntu-latest
outputs:
did_change: ${{ steps.diff.outputs.any_changed }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check for changes
id: diff
run: |
if [[ $(git diff --name-only "origin/${GITHUB_BASE_REF}" -- Dockerfile | wc -l) -gt 0 ]]; then
echo "any_changed=true" >> "$GITHUB_OUTPUT"
else
echo "any_changed=false" >> "$GITHUB_OUTPUT"
fi
build:
needs: [diff]
if: ${{ needs.diff.outputs.did_change == 'true' }}
name: Build
runs-on: ubuntu-latest
strategy:
@ -18,6 +41,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
@ -58,3 +83,12 @@ jobs:
- name: Logs
if: always()
run: docker logs thelounge
# This job is used for branch protection rule
build-check:
name: Build check
runs-on: ubuntu-latest
needs: build
if: 'failure() || cancelled()'
steps:
- run: exit 1

34
.github/workflows/validate.yml vendored Normal file
View file

@ -0,0 +1,34 @@
---
name: Validate Renovate config
on:
push:
branches:
- main
pull_request:
jobs:
validate:
name: Validate renovate config
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check for changes
id: diff
run: |
if [[ $(git diff --name-only "origin/${GITHUB_BASE_REF}" -- renovate.json | wc -l) -gt 0 ]]; then
echo "any_changed=true" >> "$GITHUB_OUTPUT"
else
echo "any_changed=false" >> "$GITHUB_OUTPUT"
fi
- shell: bash
if: ${{ steps.diff.outputs.any_changed == 'true' }}
run: |
set +o pipefail
npx -y -p renovate -c renovate-config-validator \
| tee /dev/stderr \
| grep -Evz '(ERROR|could not be parsed)'

View file

@ -12,7 +12,8 @@
"THELOUNGE_VERSION\\??=(?<currentValue>[^\\s]+)"
],
"datasourceTemplate": "npm",
"packageNameTemplate": "thelounge"
"packageNameTemplate": "thelounge",
"depNameTemplate": "thelounge"
}
],
"packageRules": [