introduce a cooldown for dependabot #9434
Workflow file for this run
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: ๐ง Linux | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - release-** | |
| pull_request: | |
| release: | |
| types: ['published'] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: build (linux) | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: ๐ฃ Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: โป๏ธ Check disk space | |
| run: df . -h | |
| - name: ๐งน Reclaim disk space | |
| run: | | |
| sudo rm -rf /usr/local/lib/android/ | |
| sudo rm -rf /opt/ghc | |
| - name: โป๏ธ Check disk space | |
| run: df . -h | |
| - name: ๐พ Prepare variables | |
| id: vars | |
| run: | | |
| ./scripts/ci/env_gh.sh | |
| BUILD_ROOT="/home/runner" | |
| echo "BUILD_ROOT=${BUILD_ROOT}" >> $GITHUB_ENV | |
| echo "BUILD_TYPE=Release" >> $GITHUB_ENV | |
| - name: ๐ Setup ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.4' # Not needed with a .ruby-version file | |
| bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
| - name: ๐ต Install Mono | |
| run: | | |
| sudo apt install ca-certificates gnupg | |
| sudo gpg --homedir /tmp --no-default-keyring --keyring gnupg-ring:/usr/share/keyrings/mono-official-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF | |
| sudo chmod +r /usr/share/keyrings/mono-official-archive-keyring.gpg | |
| echo "deb [signed-by=/usr/share/keyrings/mono-official-archive-keyring.gpg] https://download.mono-project.com/repo/ubuntu stable-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list | |
| sudo apt update | |
| sudo apt install mono-devel | |
| - name: ๐ฉ Install CMake and Ninja | |
| uses: lukka/get-cmake@latest | |
| with: | |
| cmakeVersion: 3.29.0 | |
| - name: ๐จ Prepare build env | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gperf autopoint '^libxcb.*-dev' libx11-xcb-dev libsm-dev libegl1 libegl1-mesa-dev libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev libxrandr-dev libxxf86vm-dev autoconf-archive libgstreamer-gl1.0-0 libgstreamer-plugins-base1.0-0 gstreamer1.0-pipewire libfuse2 libpulse-dev libcups2-dev nasm python3-tk libltdl-dev | |
| wget https://github.com/Kitware/CMake/releases/download/v3.31.6/cmake-3.31.6-linux-x86_64.sh -O /tmp/cmakeinstall.sh | |
| chmod +x /tmp/cmakeinstall.sh | |
| sudo /tmp/cmakeinstall.sh --prefix=/usr/local --exclude-subdir | |
| rm /tmp/cmakeinstall.sh | |
| - name: Install linuxdeploy | |
| uses: miurahr/install-linuxdeploy-action@v1 | |
| with: | |
| dir: ${{ env.BUILD_ROOT }} | |
| plugins: qt appimage | |
| - name: ๐ฑ Install dependencies and generate project files | |
| run: | | |
| source ./scripts/version_number.sh | |
| source ./scripts/ci/generate-version-details.sh | |
| cmake -S "${{ github.workspace }}" \ | |
| -B "build" \ | |
| -G Ninja \ | |
| -D CMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ | |
| -D WITH_VCPKG=ON \ | |
| -D WITH_SPIX=ON \ | |
| -D WITH_NFC=OFF \ | |
| -D APP_VERSION="${APP_VERSION}" \ | |
| -D APP_VERSION_STR="${APP_VERSION_STR}" \ | |
| -D APP_PACKAGE_NAME="${APP_PACKAGE_NAME}" \ | |
| -D ENABLE_TESTS=ON \ | |
| -D NUGET_USERNAME=opengisch \ | |
| -D NUGET_TOKEN=${{ secrets.GITHUB_TOKEN }} \ | |
| -D CMAKE_INSTALL_PREFIX=/usr \ | |
| -D CMAKE_EXPORT_COMPILE_COMMANDS=ON \ | |
| -D CMAKE_COMPILE_WARNING_AS_ERROR=ON \ | |
| -D SENTRY_DSN=${{ secrets.SENTRY_DSN }} \ | |
| -D SENTRY_ENV="${APP_ENV}" \ | |
| -D LINUXDEPLOY_EXECUTABLE=${{ env.BUILD_ROOT }}/linuxdeploy-x86_64.AppImage \ | |
| -D VCPKG_INSTALL_OPTIONS="--x-abi-tools-use-exact-versions" | |
| - name: ๐ Upload dep build logs | |
| uses: actions/upload-artifact@v7 | |
| if: failure() | |
| with: | |
| name: build-logs-x64-linux | |
| path: | | |
| build/**/*.log | |
| - name: Setup QFieldCloud | |
| run: | | |
| QFC_DIR=/tmp/qfieldcloud | |
| git clone --depth 1 https://github.com/opengisch/QFieldCloud.git $QFC_DIR | |
| cd $QFC_DIR | |
| cp .env.example .env | |
| export COMPOSE_FILE=docker-compose.yml:docker-compose.override.standalone.yml | |
| sed -i \ | |
| -e 's|^WEB_HTTP_PORT=80$|WEB_HTTP_PORT=8080|' \ | |
| -e 's|^WEB_HTTPS_PORT=443$|WEB_HTTPS_PORT=8443|' \ | |
| -e 's|^OBJECT_STORAGE_BROWSER_PORT=8010$|OBJECT_STORAGE_BROWSER_PORT=8013|' \ | |
| -e 's|^DEBUG_APP_DEBUGPY_PORT=5678$|DEBUG_APP_DEBUGPY_PORT=""|' \ | |
| -e 's|^DEBUG_WORKER_WRAPPER_DEBUGPY_PORT=5679$|DEBUG_WORKER_WRAPPER_DEBUGPY_PORT=""|' \ | |
| .env | |
| docker compose -p qfc up -d db rustfs memcached mkcert | |
| echo "Waiting for database..." | |
| for i in $(seq 1 30); do | |
| docker compose -p qfc exec -T db pg_isready -q 2>/dev/null && break | |
| [ "$i" -eq 30 ] && { docker compose -p qfc logs db --tail=20; exit 1; } | |
| sleep 2 | |
| done | |
| docker compose -p qfc up -d --build app | |
| echo "Waiting for app..." | |
| for i in $(seq 1 20); do | |
| docker compose -p qfc exec -T app python -c "print('ok')" 2>/dev/null && break | |
| [ "$i" -eq 20 ] && { docker compose -p qfc logs app --tail=20; exit 1; } | |
| sleep 2 | |
| done | |
| docker compose -p qfc exec -T app python manage.py migrate --no-input | |
| docker compose -p qfc exec -T app python manage.py collectstatic --no-input | |
| docker compose -p qfc exec -T app python manage.py createuser --username admin --email admin@localhost.local --password admin123 --superuser | |
| docker compose -p qfc up -d --build nginx | |
| echo "Waiting for nginx..." | |
| for i in $(seq 1 40); do | |
| curl -k -s -f https://localhost:8443/api/v1/status/ > /dev/null 2>&1 && break | |
| [ "$i" -eq 40 ] && { docker compose -p qfc logs nginx --tail=20; docker compose -p qfc logs mkcert --tail=10; exit 1; } | |
| sleep 3 | |
| done | |
| docker compose -p qfc ps | |
| - name: Test QFieldCloud | |
| run: | | |
| curl -k -s https://localhost:8443/api/v1/status/ | grep -q '"database":"ok"' | |
| TOKEN=$(curl -k -s -X POST https://localhost:8443/api/v1/auth/login/ \ | |
| -H "Content-Type: application/json" \ | |
| -d '{"username":"admin","password":"admin123"}' | jq -r '.token') | |
| [ "$TOKEN" != "null" ] && [ -n "$TOKEN" ] || { echo "Login failed"; exit 1; } | |
| curl -k -s -H "Authorization: Token $TOKEN" https://localhost:8443/api/v1/users/admin/ | grep -q '"username":"admin"' | |
| echo "QFieldCloud is ready" | |
| - name: Initialize CodeQL | |
| uses: github/codeql-action/init@v4 | |
| with: | |
| languages: 'c-cpp' | |
| - name: ๐ Build | |
| run: | | |
| xvfb-run cmake --build build --config ${{ env.BUILD_TYPE }} | |
| - uses: ZedThree/clang-tidy-review@v0.23.1 | |
| id: review | |
| if: github.event_name == 'pull_request' | |
| with: | |
| build_dir: "build" | |
| lgtm_comment_body: '' | |
| clang_tidy_checks: '-*,performance-*,bugprone-*,clang-analyzer-*,mpi-*,-bugprone-narrowing-conversions,-bugprone-easily-swappable-parameters,-clang-analyzer-optin.core.EnumCastOutOfRange,-performance-enum-size' | |
| - name: Package | |
| run: | | |
| export LD_LIBRARY_PATH="${{ github.workspace }}/build/vcpkg_installed/x64-linux/lib/":${LD_LIBRARY_PATH} | |
| cmake --build "build" --target bundle --config ${{ env.BUILD_TYPE }} | |
| echo "ARTIFACT_PATHNAME=build/QField-x86_64.AppImage" >> $GITHUB_ENV | |
| echo "ARTIFACT_NAME=qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}-linux-x64.AppImage" >> $GITHUB_ENV | |
| echo "ARTIFACT_PACKAGE_NAME=QField-dev-x64-linux-${{ env.BUILD_TYPE }}" >> $GITHUB_ENV | |
| - name: ๐ฆ Upload package | |
| if: ${{ env.ARTIFACT_NAME != null }} | |
| uses: actions/upload-artifact@v7 | |
| id: artifact-linux | |
| with: | |
| name: ${{ env.ARTIFACT_PACKAGE_NAME }} | |
| path: ${{ env.ARTIFACT_PATHNAME }} | |
| - name: ๐งซ Test | |
| env: | |
| PROJ_LIB: ${{ github.workspace }}/build/vcpkg_installed/x64-linux/share/proj | |
| QFIELDCLOUD_URL: https://localhost:8443 | |
| QFIELDCLOUD_USERNAME: admin | |
| QFIELDCLOUD_PASSWORD: admin123 | |
| QFIELDCLOUD_REMOTE_URL: ${{ secrets.QFIELDCLOUD_TEST_SERVER_URL }} | |
| QFIELDCLOUD_REMOTE_USERNAME: ${{ secrets.QFIELDCLOUD_TEST_USERNAME }} | |
| QFIELDCLOUD_REMOTE_PASSWORD: ${{ secrets.QFIELDCLOUD_TEST_PASSWORD }} | |
| run: | | |
| pip install -r "${{ github.workspace }}/test/spix/requirements.txt" | |
| docker compose -f "${{ github.workspace }}/test/docker-compose.yaml" up -d | |
| echo "[test-clientssl]" >> ~/.pg_service.conf | |
| echo "host=localhost" >> ~/.pg_service.conf | |
| echo "port=5440" >> ~/.pg_service.conf | |
| echo "dbname=gis" >> ~/.pg_service.conf | |
| echo "user=docker" >> ~/.pg_service.conf | |
| echo "password=docker" >> ~/.pg_service.conf | |
| echo "sslmode=require" >> ~/.pg_service.conf | |
| echo "sslcert=${{ github.workspace }}/test/postgis_docker/cert_keys/client.crt" >> ~/.pg_service.conf | |
| echo "sslkey=${{ github.workspace }}/test/postgis_docker/cert_keys/client.key" >> ~/.pg_service.conf | |
| echo "sslrootcert=${{ github.workspace }}/test/postgis_docker/cert_keys/server.crt" >> ~/.pg_service.conf | |
| chown $USER ${{ github.workspace }}/test/postgis_docker/cert_keys/client.crt | |
| chmod 700 ${{ github.workspace }}/test/postgis_docker/cert_keys/client.crt | |
| chown $USER ${{ github.workspace }}/test/postgis_docker/cert_keys/client.key | |
| chmod 700 ${{ github.workspace }}/test/postgis_docker/cert_keys/client.key | |
| chown $USER ${{ github.workspace }}/test/postgis_docker/cert_keys/server.crt | |
| chmod 700 ${{ github.workspace }}/test/postgis_docker/cert_keys/server.crt | |
| cd build | |
| export QFIELDCLOUD_URL="${QFIELDCLOUD_URL}" | |
| export QFIELDCLOUD_USERNAME="${QFIELDCLOUD_USERNAME}" | |
| export QFIELDCLOUD_PASSWORD="${QFIELDCLOUD_PASSWORD}" | |
| export QFIELDCLOUD_REMOTE_URL="${QFIELDCLOUD_REMOTE_URL}" | |
| export QFIELDCLOUD_REMOTE_USERNAME="${QFIELDCLOUD_REMOTE_USERNAME}" | |
| export QFIELDCLOUD_REMOTE_PASSWORD="${QFIELDCLOUD_REMOTE_PASSWORD}" | |
| xvfb-run --server-args="-screen 0 640x480x24" ctest --output-on-failure -C ${{ env.BUILD_TYPE }} | |
| - name: Docker cleanup | |
| if: always() | |
| run: | | |
| cd /tmp/qfieldcloud | |
| export COMPOSE_FILE=docker-compose.yml:docker-compose.override.standalone.yml | |
| docker compose -p qfc down 2>/dev/null || true | |
| docker compose -f "${{ github.workspace }}/test/docker-compose.yaml" down 2>/dev/null || true | |
| - name: ๐ Upload package logs | |
| uses: actions/upload-artifact@v7 | |
| if: failure() | |
| with: | |
| name: package-logs-x64-linux | |
| path: build/_CPack_Packages/**/*.log | |
| - name: ๐ Upload test report | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: "test-report-x64-linux-${{ env.BUILD_TYPE }}" | |
| path: "build/report" | |
| - name: ๐ Upload release asset | |
| if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v') && env.ARTIFACT_NAME != null | |
| uses: shogo82148/actions-upload-release-asset@v1 | |
| with: | |
| upload_url: ${{ github.event.release.upload_url }} | |
| asset_path: ${{ env.ARTIFACT_PATHNAME }} | |
| asset_name: ${{ env.ARTIFACT_NAME }} | |
| overwrite: true | |
| - name: ๐ฎ Upload debug symbols | |
| if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v') && env.ARTIFACT_NAME != null | |
| env: | |
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
| SENTRY_ORG_SLUG: opengisch | |
| SENTRY_PROJECT_SLUG: qfield | |
| run: | | |
| bundle exec fastlane run sentry_debug_files_upload path:build | |
| - name: Perform CodeQL Analysis | |
| uses: github/codeql-action/analyze@v4 | |
| with: | |
| category: "/language:c-cpp" | |
| - name: Schedule download comment | |
| uses: ./.github/actions/post_sticky_comment | |
| if: github.event_name == 'pull_request' | |
| with: | |
| marker: linux | |
| body: | | |
| ### ๐ง Linux AppImage builds | |
| Download a [Linux AppImage build of this PR for testing](https://nightly.link/opengisch/QField/actions/runs/${{ github.run_id }}/${{ env.ARTIFACT_PACKAGE_NAME }}.zip). | |
| *(Built from commit ${{ github.event.pull_request.head.sha }})* | |
| pr: ${{ github.event.number }} |