Skip to content

Commit

Permalink
CI updates
Browse files Browse the repository at this point in the history
This is done by the automated script named upgrade-ci-2025
  • Loading branch information
sbrunner committed Feb 14, 2025
1 parent f2b27b0 commit d43939e
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 93 deletions.
93 changes: 11 additions & 82 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -1,88 +1,22 @@
{
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',
},
vulnerabilityAlerts: {
schedule: ['at any time'],
automerge: true,
},
'pre-commit': { enabled: true },
customManagers: [
/** 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',
customType: 'regex',
},
/** Do updates on pre-commit additional dependencies */
{
fileMatch: ['^\\.pre\\-commit\\-config\\.yaml$'],
matchStrings: [" +- '?(?<depName>[^' @=]+)(@|==)(?<currentValue>[^' @=]+)'? # (?<datasource>.+)"],
customType: 'regex',
},
/** Python version in actions/setup-python action */
{
fileMatch: ['^\\.github/workflows/.*\\.yaml$'],
matchStrings: [' python-version: [\'"](?<currentValue>[0-9\\.]+)[\'"]'],
datasourceTemplate: 'python-version',
depNameTemplate: 'python',
customType: 'regex',
},
extends: [
'github>camptocamp/gs-renovate-config-preset:base.json5#0.8.1',
'github>camptocamp/gs-renovate-config-preset:group.json5#0.8.1',
'github>camptocamp/gs-renovate-config-preset:ci.json5#0.8.1',
'github>camptocamp/gs-renovate-config-preset:preset.json5#0.8.1',
'github>camptocamp/gs-renovate-config-preset:pre-commit.json5#0.8.1',
'github>camptocamp/gs-renovate-config-preset:python.json5#0.8.1',
'github>camptocamp/gs-renovate-config-preset:security.json5#0.8.1',
'github>camptocamp/gs-renovate-config-preset:own.json5#0.8.1',
'github>camptocamp/gs-renovate-config-preset:json-schema.json5#0.8.1',
'github>camptocamp/gs-renovate-config-preset:shellcheck.json5#0.8.1',
],
packageRules: [
/** Automerge the patch, the minor and the dev dependency */
{
matchUpdateTypes: ['minor', 'patch'],
automerge: true,
},
/** 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 */
{
groupName: 'Poetry',
automerge: true,
matchDepNames: ['poetry', 'pip'],
matchPackageNames: ['/^poetry\\-.*/'],
},
/** 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'],
},
/** Group and auto merge the CI dependencies */
{
matchFileNames: ['.github/**', '.pre-commit-config.yaml', 'ci/**'],
groupName: 'CI dependencies',
automerge: true,
},
/** Disable upgrading the supported Python version */
{
matchFileNames: ['pyproject.toml'],
Expand All @@ -95,10 +29,5 @@
enabled: false,
matchDepNames: ['ubuntu'],
},
/** Ungroup Python dependencies */
{
matchDepNames: ['python'],
groupName: 'Python',
},
],
}
2 changes: 2 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ permissions:
contents: write
packages: write

id-token: write

env:
HAS_SECRETS: ${{ secrets.HAS_SECRETS }}

Expand Down
25 changes: 16 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ repos:
- repo: https://github.com/sbrunner/hooks
rev: 1.1.2
hooks:
- id: poetry-check
additional_dependencies:
- poetry==2.0.1 # pypi
- id: poetry-lock
additional_dependencies:
- poetry==2.0.1 # pypi
Expand Down Expand Up @@ -61,9 +58,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 @@ -76,11 +70,21 @@ repos:
- --tool=ruff
- --die-on-tool-error
- --output-format=pylint
- --profile=.prospector-fix.yaml
- --profile=.prospector.yaml
- --profile=utils:autofix
additional_dependencies:
- prospector-profile-duplicated==1.8.1 # pypi
- prospector-profile-utils==1.11.1 # pypi
- ruff==0.7.4 # pypi
- id: prospector
args:
- --die-on-tool-error
- --output-format=pylint
- --profile=utils:tests
- --profile=utils:autofix
additional_dependencies:
- prospector-profile-utils==1.20.2 # pypi
- ruff==0.9.6 # pypi
- repo: https://github.com/camptocamp/jsonschema-gentypes
rev: 2.8.1
hooks:
Expand Down Expand Up @@ -167,11 +171,14 @@ repos:
- id: jsonschema-validator
files: |-
(?x)^(
ci/config\.yaml
|github_app_geo_project/project-schema\.json
github_app_geo_project/project-schema\.json
|github_app_geo_project/application-schema\.json
|github_app_geo_project/module/.*/schema\.json
|github_app_geo_project/module/.*/.*-schema\.json
|\.github/publish\.yaml
|jsonschema\-gentypes\.yaml
|docker/test\-app/config\.yaml
|example/changelog\-config\.yaml
)$
- repo: https://github.com/mheap/json-schema-spell-checker
rev: main
Expand Down
1 change: 1 addition & 0 deletions .prospector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ inherits:
- utils:no-design-checks
- utils:c2cwsgiutils

- utils:fix
ignore-paths:
- github_app_geo_project/project_configuration.py
- github_app_geo_project/application_configuration.py
Expand Down
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ enable = true
vcs = "git"
pattern = "^(?P<base>\\d+(\\.\\d+)*)"
format-jinja = """
{%- if env.get("VERSION_TYPE") == "version_branch" -%}
{{serialize_pep440(bump_version(base, 1 if env.get("IS_MASTER") == "TRUE" else 2), dev=distance)}}
{%- if env.get("VERSION_TYPE") == "default_branch" -%}
{{serialize_pep440(bump_version(base, 1), dev=distance)}}
{%- elif env.get("VERSION_TYPE") == "stabilization_branch" -%}
{{serialize_pep440(bump_version(base, 2), dev=distance)}}
{%- elif distance == 0 -%}
{{serialize_pep440(base)}}
{%- else -%}
Expand Down

0 comments on commit d43939e

Please sign in to comment.