From 34390a342313421418352f22234d3ccaf033a2ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Thu, 30 Nov 2023 12:53:27 +0100 Subject: [PATCH] CI updates This is done by the automated script named upgrade-c2cciutils-to-1.7 --- .github/renovate.json5 | 98 ------------------- .github/workflows/audit.yaml | 53 ---------- .github/workflows/auto-review.yaml | 21 ---- .github/workflows/changelog.yaml | 12 ++- .github/workflows/dependency-auto-review.yaml | 26 +++++ .github/workflows/pr-checks.yaml | 1 + .github/workflows/rebuild-115.yaml | 72 -------------- .github/workflows/rebuild.yaml | 51 ---------- .pre-commit-config.yaml | 2 +- ci/config.yaml | 2 +- 10 files changed, 36 insertions(+), 302 deletions(-) delete mode 100644 .github/renovate.json5 delete mode 100644 .github/workflows/audit.yaml delete mode 100644 .github/workflows/auto-review.yaml create mode 100644 .github/workflows/dependency-auto-review.yaml delete mode 100644 .github/workflows/rebuild-115.yaml delete mode 100644 .github/workflows/rebuild.yaml diff --git a/.github/renovate.json5 b/.github/renovate.json5 deleted file mode 100644 index 9615dc076..000000000 --- a/.github/renovate.json5 +++ /dev/null @@ -1,98 +0,0 @@ -{ - 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', - }, - baseBranches: ['1.15', '1.17', '1.18', '1.19', 'master'], - 'pre-commit': { enabled: true }, - regexManagers: [ - { - fileMatch: ['^.pre-commit-config.yaml$'], - matchStrings: [" +- '?(?[^' @=]+)(@|==)(?[^' @=]+)'? # (?.+)"], - }, - ], - packageRules: [ - /** Docker images versioning */ - { - matchDatasources: ['docker'], - versioning: 'loose', - }, - { - matchDatasources: ['docker'], - matchPackageNames: ['camptocamp/mapserver'], - versioning: 'regex:^(?\\d+)\\.(?\\d+)$', - }, - { - matchDatasources: ['docker'], - matchPackageNames: ['redis'], - versioning: 'regex:^(?\\d+)\\.(?\\d+)\\.(?\\d+)$', - }, - { - matchDatasources: ['docker'], - matchPackageNames: ['ghcr.io/osgeo/gdal'], - versioning: 'regex:^(?.*)-(?\\d+)\\.(?\\d+)\\.(?\\d+)?$', - }, - /** Automerge the patch, the minor and the dev dependency */ - { - matchUpdateTypes: ['minor', 'patch'], - automerge: true, - }, - { - matchDepTypes: ['devDependencies'], - automerge: true, - }, - /** Group the patch and the minor */ - { - matchUpdateTypes: ['patch'], - groupName: 'all patch versions', - automerge: true, - }, - { - matchUpdateTypes: ['minor'], - groupName: 'all minor versions', - automerge: true, - }, - /** Group Poetry packages */ - { - matchPackageNames: ['poetry', 'pip'], - matchPackagePrefixes: ['poetry-'], - groupName: 'Poetry', - automerge: true, - separateMajorMinor: false, - separateMinorPatch: false, - }, - /** Accept only the patch on the stabilization branches */ - { - matchBaseBranches: ['/1\\..*/'], - matchUpdateTypes: ['major', 'minor', 'pin', 'digest', 'lockFileMaintenance', 'rollback', 'bump'], - enabled: false, - }, - /** Disable upgrading the supported Python version */ - { - matchFileNames: ['pyproject.toml'], - matchPackageNames: ['python'], - enabled: false, - }, - /** Only LTS version of Node */ - { - allowedVersions: '/(0|2|4|6|8)$/', - matchPackageNames: ['node'], - enabled: false, - }, - /** Disable types-request update on version <= 1.19 */ - { - matchPackageNames: ['types-requests'], - matchBaseBranches: ['1.17', '1.18', '1.19'], - enabled: false, - }, - ], -} diff --git a/.github/workflows/audit.yaml b/.github/workflows/audit.yaml deleted file mode 100644 index 10fc6ee31..000000000 --- a/.github/workflows/audit.yaml +++ /dev/null @@ -1,53 +0,0 @@ -name: Audit - -on: - schedule: - - cron: '30 2 * * *' - -jobs: - audit: - runs-on: ubuntu-22.04 - name: Audit - timeout-minutes: 10 - - strategy: - fail-fast: false - matrix: - branch: - - '1.15' - - '1.17' - - '1.18' - - '1.19' - - steps: - - run: pip install pyOpenSSL --upgrade - - - uses: actions/checkout@v4 - with: - ref: ${{ matrix.branch }} - token: ${{ secrets.GOPASS_CI_GITHUB_TOKEN }} - - - uses: camptocamp/initialise-gopass-summon-action@v2 - with: - ci-gpg-private-key: ${{secrets.CI_GPG_PRIVATE_KEY}} - github-gopass-ci-token: ${{secrets.GOPASS_CI_GITHUB_TOKEN}} - - - run: python3 -m venv ~/.venv - - run: ~/.venv/bin/pip install --pre c2cciutils[audit] - - run: python3 -m pip install --pre c2cciutils[audit] - - - name: Check .tool-versions file existence - id: tool-versions - uses: andstor/file-existence-action@v2 - with: - files: .tool-versions - - uses: asdf-vm/actions/install@v3 - if: steps.tool-versions.outputs.files_exists == 'true' - - run: cat /tmp/python-build.*.log - if: failure() - - run: python --version - - - name: Audit - run: ~/.venv/bin/c2cciutils-audit --branch=${{ matrix.branch }} - env: - GITHUB_TOKEN: ${{ secrets.GOPASS_CI_GITHUB_TOKEN }} diff --git a/.github/workflows/auto-review.yaml b/.github/workflows/auto-review.yaml deleted file mode 100644 index 342c350ff..000000000 --- a/.github/workflows/auto-review.yaml +++ /dev/null @@ -1,21 +0,0 @@ -name: Auto reviews updates - -on: - pull_request: - types: - - opened - - reopened - - synchronize - -jobs: - auto-merge: - name: Auto reviews updates - runs-on: ubuntu-22.04 - timeout-minutes: 5 - - steps: - - name: Auto reviews updates - uses: golfzaptw/action-auto-reviews-from-branches@master - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - AUTHOR: renovate[bot] diff --git a/.github/workflows/changelog.yaml b/.github/workflows/changelog.yaml index 8964d0736..cfd5cc44f 100644 --- a/.github/workflows/changelog.yaml +++ b/.github/workflows/changelog.yaml @@ -17,7 +17,7 @@ jobs: - uses: actions/checkout@v4 if: github.event_name == 'push' && github.ref_type == 'tag' - name: Create release - run: | + run: |- if [[ ${{ github.ref_name }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then gh release create ${{ github.ref_name }} --generate-notes || true fi @@ -27,23 +27,25 @@ jobs: - name: Get Date id: get-date - run: | - echo "date=$(/bin/date -u "+%Y%m%d%H%M%S")" >> $GITHUB_OUTPUT + run: echo "date=$(/bin/date -u "+%Y%m%d%H%M%S")" >> $GITHUB_OUTPUT - uses: actions/cache@v3 with: path: .cache key: automation-${{ steps.get-date.outputs.date }} - restore-keys: | + restore-keys: |+ automation- - run: docker pull aeonphp/automation - name: Generate changelog - run: > + run: >- docker run --env=AEON_AUTOMATION_GH_TOKEN --rm --volume=$(pwd)/.cache:/cache aeonphp/automation changelog:generate:all ${{ github.repository }} --github-release-update --cache-path=/cache + --skip-from=dependabot-preview[bot] + --skip-from=dependabot[bot] + --skip-from=renovate[bot] -v env: AEON_AUTOMATION_GH_TOKEN: ${{ secrets.GOPASS_CI_GITHUB_TOKEN }} diff --git a/.github/workflows/dependency-auto-review.yaml b/.github/workflows/dependency-auto-review.yaml new file mode 100644 index 000000000..00f71603f --- /dev/null +++ b/.github/workflows/dependency-auto-review.yaml @@ -0,0 +1,26 @@ +name: Auto reviews updates + +on: + pull_request: + types: + - opened + - reopened + +jobs: + auto-merge: + name: Auto reviews updates + runs-on: ubuntu-22.04 + timeout-minutes: 5 + if: github.event.pull_request.user.login == 'renovate[bot]' + + steps: + - name: Auto reviews updates + uses: golfzaptw/action-auto-reviews-from-branches@master + with: + script: |- + github.rest.pulls.createReview({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request.number, + event: 'APPROVE', + }) diff --git a/.github/workflows/pr-checks.yaml b/.github/workflows/pr-checks.yaml index ea48b3cd8..538479214 100644 --- a/.github/workflows/pr-checks.yaml +++ b/.github/workflows/pr-checks.yaml @@ -15,6 +15,7 @@ jobs: name: Pull request check runs-on: ubuntu-22.04 timeout-minutes: 5 + if: github.event.pull_request.user.login != 'renovate[bot]' steps: - run: pip install --upgrade attrs diff --git a/.github/workflows/rebuild-115.yaml b/.github/workflows/rebuild-115.yaml deleted file mode 100644 index 93569ad7f..000000000 --- a/.github/workflows/rebuild-115.yaml +++ /dev/null @@ -1,72 +0,0 @@ -name: Rebuild 1.15 - -on: - schedule: - - cron: 30 2 * * * - -jobs: - rebuild: - runs-on: ubuntu-22.04 - name: Rebuild 1.15 - timeout-minutes: 20 - - strategy: - fail-fast: false - matrix: - branch: - - '1.15' - - env: - REDIS_URL: redis://localhost:6379 - - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ matrix.branch }} - - - uses: camptocamp/initialise-gopass-summon-action@v2 - with: - ci-gpg-private-key: ${{secrets.CI_GPG_PRIVATE_KEY}} - github-gopass-ci-token: ${{secrets.GOPASS_CI_GITHUB_TOKEN}} - patterns: pypi docker - if: github.repository == 'camptocamp/tilecloud-chain' - - - run: echo "${HOME}/.local/bin" >> ${GITHUB_PATH} - - run: python3 -m pip install --user --requirement=ci/requirements.txt - - - name: Checks - run: c2cciutils-checks - - - run: touch tilecloud_chain/OpenLayers.js - - - name: Build - run: | - python setup.py --long-description > PYPI.md - docker build --tag=camptocamp/tilecloud-chain:tests --target=tests . - docker build --tag=camptocamp/tilecloud-chain . - git --no-pager diff --check `git log --oneline | tail -1 | cut --fields=1 --delimiter=' '` - - - name: Start - run: | - docker-compose up -d - - # Wait for DB to be up - while ! docker-compose exec -T test psql -h db -p 5432 -U postgres -v ON_ERROR_STOP=1 -c "SELECT 1" -d tests - do - echo "Waiting for DB to be UP" - sleep 1 - done - timeout-minutes: 2 - - name: Test - run: | - docker-compose exec -T test pytest - - docker-compose down - - - run: docker-compose logs - if: failure() - - - run: python3 -m pip install --requirement=requirements-publish.txt - - - name: Publish - run: c2cciutils-publish --type=rebuild --branch=${{ matrix.branch }} diff --git a/.github/workflows/rebuild.yaml b/.github/workflows/rebuild.yaml deleted file mode 100644 index f4526e108..000000000 --- a/.github/workflows/rebuild.yaml +++ /dev/null @@ -1,51 +0,0 @@ -name: Rebuild - -on: - schedule: - - cron: 30 2 * * * - -jobs: - rebuild: - runs-on: ubuntu-22.04 - name: Rebuild - timeout-minutes: 20 - - strategy: - fail-fast: false - matrix: - branch: - - '1.17' - - '1.18' - - env: - REDIS_URL: redis://localhost:6379 - - steps: - - run: docker system prune --all --force - - uses: actions/checkout@v4 - with: - ref: ${{ matrix.branch }} - - - uses: camptocamp/initialise-gopass-summon-action@v2 - with: - ci-gpg-private-key: ${{secrets.CI_GPG_PRIVATE_KEY}} - github-gopass-ci-token: ${{secrets.GOPASS_CI_GITHUB_TOKEN}} - patterns: pypi docker - - - run: echo "${HOME}/.local/bin" >> ${GITHUB_PATH} - - run: python3 -m pip install --user --requirement=ci/requirements.txt - - - name: Checks - run: c2cciutils-checks - - - name: Build - run: make build - - - name: Tests - run: make tests - - - run: c2cciutils-docker-logs - if: always() - - - name: Publish - run: c2cciutils-publish --type=rebuild --branch=${{ matrix.branch }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 13e92e499..7bf5ef52d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: - id: trailing-whitespace - id: mixed-line-ending - repo: https://github.com/mheap/json-schema-spell-checker - rev: master + rev: main hooks: - id: json-schema-spell-checker files: tilecloud_chain/schema.json diff --git a/ci/config.yaml b/ci/config.yaml index 95bed055e..985405934 100644 --- a/ci/config.yaml +++ b/ci/config.yaml @@ -1,4 +1,4 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/camptocamp/c2cciutils/master/c2cciutils/schema.json +# yaml-language-server: $schema=https://raw.githubusercontent.com/camptocamp/c2cciutils/1.6.10/c2cciutils/schema.json publish: docker: