Fix lint issues flagged by prospector/ruff #15547
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Continuous integration | |
| on: | |
| push: | |
| permissions: | |
| contents: write | |
| packages: write | |
| id-token: write | |
| jobs: | |
| main: | |
| runs-on: ubuntu-24.04 | |
| name: Continuous integration | |
| timeout-minutes: 20 | |
| steps: | |
| - run: df -h | |
| - name: Clean all docker images | |
| run: docker system prune --all --force | |
| # Inspired by https://github.com/jlumbroso/free-disk-space/ | |
| - run: sudo rm -rf /usr/local/lib/android /usr/share/dotnet "$AGENT_TOOLSDIRECTORY" | |
| - run: df -h | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| repository: camptocamp/demo_geomapfish_data | |
| ref: master | |
| path: data | |
| - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | |
| - run: python3 -m pip install --requirement=ci/requirements.txt | |
| - name: Environment information | |
| run: c2cciutils-env | |
| - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| 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 --config=.pre-commit-config.yaml | |
| - run: git diff --exit-code --patch > /tmp/pre-commit.patch || true | |
| if: failure() | |
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| 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_10;" | |
| docker compose exec tools psql -c "ALTER SCHEMA static_2_7 RENAME TO static_2_10;" | |
| - 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: tag-publish | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # - name: Create Sentry release | |
| # uses: getsentry/action-release@v1 | |
| # env: | |
| # SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
| # SENTRY_ORG: camptocamp | |
| # SENTRY_PROJECT: ${{ env.SENTRY_PROJECT }} | |
| # with: | |
| # environment: ${{ env.SENTRY_ENVIRONMENT }} | |
| # if: github.ref == 'refs/heads/prod-2-8' | |
| - 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() |