Skip to content

ngeo_2.7_updated

ngeo_2.7_updated #323

Workflow file for this run

name: Update ngeo 2.7
on:
repository_dispatch:
types:
- ngeo_2.7_updated
env:
HAS_SECRETS: ${{ secrets.HAS_SECRETS }}
jobs:
main:
runs-on: ubuntu-22.04
name: Continuous integration
timeout-minutes: 90
env:
MAIN_BRANCH: '2.7'
MAJOR_VERSION: '2.7'
steps:
- run: '! ls BACKPORT_TODO'
- run: df -h
- run: docker system prune --all --force
- run: sudo rm -rf /usr/local/lib/android
- run: df -h
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GOPASS_CI_GITHUB_TOKEN }}
ref: ${{ env.MAIN_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 transifex
- run: echo "${HOME}/.local/bin" >> ${GITHUB_PATH}
- run: python3 -m pip install --user --requirement=ci/requirements.txt
- name: Checks
run: c2cciutils-checks
- run: python3 -m pip install --user --requirement=requirements.txt
# Build images
- run: make build-runner
- run: make build-tools
- run: make checks
if: always()
- run: make build-config
# Build and lint QGIS images
- run: docker build --target=lint --build-arg=VERSION=3.22 docker/qgisserver
- run: QGIS_VERSION=3.22 make build-qgisserver
# Tests
- run: make preparetest
- run: docker-compose logs --timestamps
if: failure()
# Similar to: make tests-commons
- run: >
docker-compose exec -T tests pytest --verbose --color=yes --junitxml=/tmp/commons.xml
/opt/c2cgeoportal/commons/tests
- run: c2cciutils-docker-logs
# Similar to: make tests-geoportal
- run: >
docker-compose exec -T tests pytest --verbose --color=yes --junitxml=/tmp/geoportal.xml
/opt/c2cgeoportal/geoportal/tests
- run: c2cciutils-docker-logs
# Similar to: make tests-admin
- run: >
docker-compose exec -T tests pytest --verbose --color=yes --junitxml=/tmp/admin.xml
/opt/c2cgeoportal/admin/tests
- run: c2cciutils-docker-logs
# Similar to: make tests-qgisserver
- run: >
docker-compose exec -T qgisserver-tests pytest --verbose --color=yes --junitxml=/tmp/qgis.xml
/src/tests/functional
- run: c2cciutils-docker-logs
if: always()
- run: docker-compose down
- run: sudo git clean -fdx
# Documentation
- run: >
docker build --tag=camptocamp/geomapfish-doc
--build-arg=MAJOR_VERSION=${MAJOR_VERSION}
--build-arg=MAIN_BRANCH=${MAIN_BRANCH}
doc
- name: Extract documentation
run: ci/extract-documentation artifacts/documentations/ || true
if: always()
- uses: actions/upload-artifact@v4
if: always()
with:
name: Documentation
path: artifacts/documentations/
if-no-files-found: ignore
retention-days: 5
# Test App
- run: ci/test-app
- name: Docker logs
run: |
cd ${HOME}/workspace/testgeomapfishapp/
c2cciutils-docker-logs
if: failure()
continue-on-error: true
- run: git pull --ff-only origin ${{ env.MAIN_BRANCH }}
- run: scripts/get-version --auto-increment --github
id: version
# Test Upgrade
- run: DOCKER_TAG=${{ steps.version.outputs.full }} make build-tools
- run: DOCKER_TAG=${{ steps.version.outputs.full }} make build-runner
- run: DOCKER_TAG=${{ steps.version.outputs.full }} make build-config
- run: docker images | grep "<none>" | awk '{print $3}' | xargs --no-run-if-empty docker rmi || true
- run: ci/test-upgrade init ${HOME}/workspace
- run: ci/test-upgrade 240 ${HOME}/workspace
- run: ci/test-upgrade 260 ${HOME}/workspace
- run: ci/test-upgrade 27 ${HOME}/workspace
- run: ci/test-upgrade cleanup ${HOME}/workspace
- name: Init Git
run:
git remote set-url origin https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository
}}
- run: make build-tools
- run: make build-runner
- run: make build-config
- run: ci/create-new-project ${HOME}/workspace geomapfishapp
- run: (cd ${HOME}/workspace/geomapfishapp/; ./build)
- name: Update the changelog
run: ci/changelog ${{ steps.version.outputs.full }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: git diff CHANGELOG.md
- name: Push version and changelog
run: |
set -eux
git add ci/ci.yaml ci/changelog.yaml CHANGELOG.md
git diff --staged --quiet || (\
git commit -m "[skip ci] Update the minor version"; \
git push origin HEAD:${{ env.MAIN_BRANCH }} \
)
- name: Publish version branch
run: |
c2cciutils-publish --type=version_branch --version=${{ steps.version.outputs.major }}
c2cciutils-publish --type=version_branch --version=${{ steps.version.outputs.major_minor }}
c2cciutils-publish --group=full --type=version_branch --version=${{ steps.version.outputs.full }}
- name: Notify demo
run: >
curl --request POST --header "Content-Type: application/json"
--header 'Accept: application/vnd.github.v3+json'
--header "Authorization: token ${{ secrets.GOPASS_CI_GITHUB_TOKEN }}"
https://api.github.com/repos/camptocamp/demo_geomapfish/dispatches
--data '{"event_type": "geomapfish_${{ env.MAJOR_VERSION }}_updated",
"client_payload": {"version": "'"${{ steps.version.outputs.upgrade_version }}"'"}}'
- run: >
docker run --rm --volume=/var/run/docker.sock:/var/run/docker.sock nate/dockviz
images --tree
if: always()
- run: docker images
if: always()
- run: docker system df
if: always()
- run: df -h
if: always()