chore(ci): add renovate validation workflow (#168)
This commit is contained in:
parent
bec4974f55
commit
4dbcf181e5
2
.github/workflows/docker-image-push.yml
vendored
2
.github/workflows/docker-image-push.yml
vendored
|
@ -25,7 +25,7 @@ jobs:
|
|||
fail-fast: false
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
|
|
34
.github/workflows/docker-image-test.yml
vendored
34
.github/workflows/docker-image-test.yml
vendored
|
@ -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
34
.github/workflows/validate.yml
vendored
Normal 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)'
|
|
@ -12,7 +12,8 @@
|
|||
"THELOUNGE_VERSION\\??=(?<currentValue>[^\\s]+)"
|
||||
],
|
||||
"datasourceTemplate": "npm",
|
||||
"packageNameTemplate": "thelounge"
|
||||
"packageNameTemplate": "thelounge",
|
||||
"depNameTemplate": "thelounge"
|
||||
}
|
||||
],
|
||||
"packageRules": [
|
||||
|
|
Loading…
Reference in a new issue