Skip to content

Apply pre-commit fix #8206

Apply pre-commit fix

Apply pre-commit fix #8206

Workflow file for this run

name: Continuous integration
on:
push:
pull_request_target:
types: [labeled]
env:
PROJECT: demo
HAS_SECRETS: ${{ secrets.HAS_SECRETS }}
jobs:
main:
name: Continuous integration
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: camptocamp/demo_geomapfish_data
ref: master
path: data
- 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: docker
if: env.HAS_SECRETS == 'HAS_SECRETS'
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: python3 -m pip install --requirement=ci/requirements.txt
- name: Environment information
run: c2cciutils-env
- uses: actions/cache@v4
with:
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: git diff --exit-code --patch > /tmp/pre-commit.patch || true
if: failure()
- uses: actions/upload-artifact@v4
with:
name: Apply pre-commit fix.patch
path: /tmp/pre-commit.patch
retention-days: 1
if: failure()
# Can be used to have some secrets (with mask)
# - run: make secrets
# - run: cat env.secrets |grep '^[# A-Z0-9_]\+='|sed -e 's/^[# A-Z0-9_]\+=\(.*\)/::add-mask::\1/g'
- run: touch env.secrets
- name: Build
run: ./build
- name: Application checks
run: make checks
- name: Initialize the acceptance tests
run: make acceptance-init
- run: c2cciutils-docker-logs
- name: Fix null values
run: docker compose exec tools psql -c "UPDATE main_2_7.tsearch SET label = 'no-label' WHERE label is NULL;"
- name: Rename schemas
run: |
docker compose exec tools psql -c "ALTER SCHEMA main_2_7 RENAME TO main_2_9;"
docker compose exec tools psql -c "ALTER SCHEMA static_2_7 RENAME TO static_2_9;"
- name: Run Alembic main
run: docker compose --file=docker-compose.yaml --file=docker-compose-db.yaml up alembic-main
- name: Run Alembic static
run: docker compose --file=docker-compose.yaml --file=docker-compose-db.yaml up alembic
- run: c2cciutils-docker-logs
- name: Run the acceptance tests
run: make acceptance
- run: c2cciutils-docker-logs
- run: make acceptance-dev
- run: c2cciutils-docker-logs
- run:
docker compose --file=docker-compose.yaml --file=docker-compose-db.yaml --file=docker-compose.override.sample.yaml
up -d
- name: Run the acceptance tests on dev
run: make acceptance
- run: c2cciutils-docker-logs
if: always()
# Rebuild the image with the right schema
- run: rm env.secrets
- run: touch env.secrets
- name: Build
run: ./build --no-pull
- name: Publish
run: c2cciutils-publish
- run: git diff --exit-code --patch > /tmp/dpkg-versions.patch || true
if: failure()
- uses: actions/upload-artifact@v4
with:
name: Update dpkg versions list.patch
path: /tmp/dpkg-versions.patch
retention-days: 1
if: failure()