diff --git a/.github/workflows/additional_checks.yml b/.github/workflows/additional_checks.yml deleted file mode 100644 index 76554f24db3..00000000000 --- a/.github/workflows/additional_checks.yml +++ /dev/null @@ -1,73 +0,0 @@ ---- -name: Additional Checks - -# Checks which are not in standardized tools such as custom checks by scripts -# in the source code or small 3rd party checks without large projects behind them. -# Number of disconnected, but simple checks can be combined into one workflow -# (and job) to reduce the number of jobs. - -on: - push: - branches: - - main - - releasebranch_* - pull_request: - -concurrency: - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} - cancel-in-progress: true - -jobs: - additional-checks: - name: Additional checks - runs-on: ubuntu-22.04 - - steps: - - name: Checkout repository contents - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - fetch-depth: 31 - - - name: Check what files were changed - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 - id: changes - with: - filters: | - precommit: - - '.pre-commit-config.yaml' - - - name: Check for CRLF endings - uses: erclu/check-crlf@94acb86c2a41b0a46bd8087b63a06f0457dd0c6c # v1.2.0 - with: - # Ignore all test data, Windows-specific directories and scripts. - exclude: mswindows .*\.bat .*/testsuite/data/.* - - - name: Set up Python - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 - with: - python-version: '3.10' - - - name: Check that files with the same content are the same - run: | - diff Dockerfile docker/ubuntu/Dockerfile - - - name: Generate core modules with last commit JSON file and test it - run: | - python -m pip install pytest pytest-depends - python utils/generate_last_commit_file.py . - pytest utils/test_generate_last_commit_file.py - - - name: Generate release notes using git log - run: | - python -m pip install PyYAML requests - # Git works without any special permissions. - # Using current branch or the branch against the PR is open. - # Using the last 30 commits (for branches, tags, and PRs). - # End is the current (latest) commit. - python ./utils/generate_release_notes.py log \ - ${{ github.ref_name }} \ - $(git rev-parse HEAD~30) \ - "" - - - run: pip install pre-commit && pre-commit run -a - if: ${{ steps.changes.outputs.precommit == 'true' }} diff --git a/.github/workflows/clang-format-check.yml b/.github/workflows/clang-format-check.yml deleted file mode 100644 index 489d8197c09..00000000000 --- a/.github/workflows/clang-format-check.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -name: ClangFormat Check -on: - push: - branches: - - main - - releasebranch_* - pull_request: - workflow_dispatch: -concurrency: - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} - cancel-in-progress: true -permissions: {} -jobs: - formatting-check: - name: Formatting Check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - persist-credentials: false - - uses: DoozyX/clang-format-lint-action@c71d0bf4e21876ebec3e5647491186f8797fde31 # v0.18.2 - with: - source: "." - clangFormatVersion: 18.1.8 - inplace: True - - name: Create and uploads code suggestions to apply - id: diff - uses: ./.github/actions/create-upload-suggestions - with: - tool-name: clang-format - # To keep repo's file structure in formatted changes artifact - extra-upload-changes: .clang-format diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index d98950b0818..00000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,86 +0,0 @@ ---- -name: CodeQL - -on: - push: - branches: - - main - pull_request: - paths-ignore: - - '**/*.html' - - '**/*.md' - - '**/*.txt' - schedule: - # Check every Saturday at 18:36 - - cron: 36 18 * * 6 - -permissions: {} - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-22.04 - permissions: - security-events: write - actions: read - contents: read - - strategy: - fail-fast: false - matrix: - language: - - c-cpp - - python - - concurrency: - group: ${{ github.workflow }}-${{ - github.event_name == 'pull_request' && - github.head_ref || github.sha }}-${{ matrix.language }} - cancel-in-progress: true - - steps: - - name: Checkout repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Set up Python - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 - with: - python-version: '3.x' - - name: Install non-Python dependencies - if: ${{ matrix.language == 'c-cpp' }} - run: | - sudo apt-get update -y - sudo apt-get install -y wget git gawk findutils - xargs -a <(awk '! /^ *(#|$)/' ".github/workflows/apt.txt") -r -- \ - sudo apt-get install -y --no-install-recommends --no-install-suggests - - uses: rui314/setup-mold@b015f7e3f2938ad3a5ed6e5111a8c6c7c1d6db6e # v1 - if: ${{ matrix.language == 'c-cpp' }} - - - name: Initialize CodeQL - uses: github/codeql-action/init@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0 - with: - languages: ${{ matrix.language }} - config-file: ./.github/codeql/codeql-config.yml - - - name: Create installation directory - run: | - mkdir "${HOME}/install" - - - name: Set LD_LIBRARY_PATH for compilation - run: | - echo "LD_LIBRARY_PATH=${HOME}/install/lib" >> $GITHUB_ENV - - - name: Set number of cores for compilation - run: | - echo "MAKEFLAGS=-j$(nproc)" >> $GITHUB_ENV - - - name: Build - if: ${{ matrix.language == 'c-cpp' }} - env: - CFLAGS: -std=gnu11 - CXXFLAGS: -std=c++11 - run: .github/workflows/build_ubuntu-22.04.sh "${HOME}/install" - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0 - with: - category: "/language:${{matrix.language}}" diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml deleted file mode 100644 index 5253a9ee7a4..00000000000 --- a/.github/workflows/coverity.yml +++ /dev/null @@ -1,113 +0,0 @@ ---- -name: Coverity Scan - -on: - workflow_dispatch: # run whenever a contributor calls it - schedule: - - cron: '48 5 * * *' # Run at 05:48 - # Coverity will let GRASS do a scan a maximum of twice per day, so this - # schedule will help GRASS fit within that limit with some additional space - # for manual runs -permissions: - contents: read - # action based off of - # https://github.com/OSGeo/PROJ/blob/905c9a6c2da3dc6b7aa2c89d3ab78d9d1a9cd070/.github/workflows/coverity-scan.yml -jobs: - coverity: - runs-on: ubuntu-22.04 - if: github.repository == 'OSGeo/grass' - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - name: Get dependencies - run: | - sudo apt-get update -y - sudo apt-get install -y wget git gawk findutils - xargs -a <(awk '! /^ *(#|$)/' ".github/workflows/apt.txt") -r -- \ - sudo apt-get install -y --no-install-recommends --no-install-suggests - - - name: Create installation directory - run: | - mkdir $HOME/install - - - name: Download Coverity Build Tool - run: | - wget -q https://scan.coverity.com/download/cxx/linux64 \ - --post-data "token=${TOKEN}&project=grass" -O cov-analysis-linux64.tar.gz - mkdir cov-analysis-linux64 - tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64 - env: - TOKEN: ${{ secrets.COVERITY_PASSPHRASE }} - - - name: Set number of cores for compilation - run: | - echo "MAKEFLAGS=-j$(nproc)" >> $GITHUB_ENV - - - name: Set LD_LIBRARY_PATH for compilation - run: | - echo "LD_LIBRARY_PATH=$HOME/install/lib" >> $GITHUB_ENV - - - name: Print build environment variables - run: | - printenv | sort - gcc --version - ldd --version - - - name: Configure - run: | - echo "CFLAGS=${{ env.CFLAGS }}" >> $GITHUB_ENV - echo "CXXFLAGS=${{ env.CXXFLAGS }}" >> $GITHUB_ENV - ./configure \ - --enable-largefile \ - --prefix="$HOME/install/" \ - --with-blas \ - --with-bzlib \ - --with-cxx \ - --with-fftw \ - --with-freetype \ - --with-freetype-includes="/usr/include/freetype2/" \ - --with-geos \ - --with-lapack \ - --with-netcdf \ - --with-pdal \ - --with-proj-share=/usr/share/proj \ - --with-readline \ - --with-sqlite \ - --with-tiff \ - --with-zstd \ - --without-openmp \ - --without-pthread - - env: - CFLAGS: -fPIC -g - CXXFLAGS: -fPIC -g - - - name: Build with cov-build - run: | - pwd - export PATH="$(pwd)/cov-analysis-linux64/bin:${PATH}" - cov-build --dir cov-int make - - - name: Put results into Tarball - run: | - tar czvf grass.tgz cov-int - - - name: Submit to Coverity Scan - run: | - version=$(head -n 3 include/VERSION | xargs | sed 's/ /./g') - commit=$(git rev-parse --short HEAD) - branch=$(git rev-parse --abbrev-ref HEAD) - desc="Version:${version}, commit:${commit}, branch:${branch}." - echo "Submitting ${desc}" - desc_url_enc=$(echo "$desc" | sed 's/:/%3A/g' | sed 's/,/%2C/g' | sed 's/ /%20/g') - tar czvf grass.tgz cov-int - curl \ - --form "token=${TOKEN}" \ - --form "email=${EMAIL}" \ - --form "file=@grass.tgz" \ - --form "version=${version}-${commit}" \ - --form "description=${desc_url_enc}" \ - 'https://scan.coverity.com/builds?project=grass' - env: - TOKEN: ${{ secrets.COVERITY_PASSPHRASE }} - EMAIL: ${{ secrets.COVERITY_USER }} diff --git a/.github/workflows/create_release_draft.yml b/.github/workflows/create_release_draft.yml deleted file mode 100644 index 8147136c2eb..00000000000 --- a/.github/workflows/create_release_draft.yml +++ /dev/null @@ -1,94 +0,0 @@ ---- -name: Create or check a release draft - -on: - push: - branches: - - main - - releasebranch_* - tags: - - '**' - pull_request: - paths: - - .github/** - - utils/** - -concurrency: - group: >- - ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} - cancel-in-progress: true - -env: - OUT_DIR: ${{ github.workspace }}/../grass_outdir - GRASS: grass-${{ github.ref_name }} -permissions: {} -jobs: - build: - name: Package and create release draft - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: Checks-out repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - ref: ${{ github.ref }} - fetch-depth: 0 - - name: Set up Python - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 - with: - python-version: '3.11' - - name: Create output directory - run: | - mkdir ${{ env.OUT_DIR }} - - name: Generate ChangeLog file - run: | - python utils/gitlog2changelog.py - mv ChangeLog ${{ env.OUT_DIR }}/ChangeLog - gzip ${{ env.OUT_DIR }}/ChangeLog - - name: Generate Git derived data files - run: | - echo "Generate VERSION_GIT file:" - ./utils/generate_version_git_file.sh - cat include/VERSION_GIT - echo "Generate GENERATE_LAST_COMMIT_FILE:" - python utils/generate_last_commit_file.py . - cat core_modules_with_last_commit.json - echo "Create core modules patch file:" - git add core_modules_with_last_commit.json - git diff --cached > \ - ${{ env.OUT_DIR }}/core_modules_with_last_commit.patch - - name: Create tarballs (for tags only) - if: startsWith(github.ref, 'refs/tags/') - run: | - cd .. - tar -cvf ${{ env.OUT_DIR }}/${{ env.GRASS }}.tar \ - --exclude=".gi*" --exclude=".tr*" \ - --transform s/grass/${{ env.GRASS }}/ grass - cd ${{ env.OUT_DIR }} - gzip -9k ${{ env.GRASS }}.tar - md5sum ${{ env.GRASS }}.tar.gz > ${{ env.GRASS }}.tar.gz.md5 - sha256sum ${{ env.GRASS }}.tar.gz > ${{ env.GRASS }}.tar.gz.sha256 - xz -9e ${{ env.GRASS }}.tar - md5sum ${{ env.GRASS }}.tar.xz > ${{ env.GRASS }}.tar.xz.md5 - sha256sum ${{ env.GRASS }}.tar.xz > ${{ env.GRASS }}.tar.xz.sha256 - - name: Publish draft distribution to GitHub (for tags only) - if: startsWith(github.ref, 'refs/tags/') - uses: softprops/action-gh-release@e7a8f85e1c67a31e6ed99a94b41bd0b71bbee6b8 # v2.0.9 - with: - name: GRASS GIS ${{ github.ref_name }} - body: | - Overview of changes - - First change - - Second change - draft: true - prerelease: ${{ contains(github.ref, 'RC') }} - files: | - ${{ env.OUT_DIR }}/${{ env.GRASS }}.tar.gz - ${{ env.OUT_DIR }}/${{ env.GRASS }}.tar.gz.md5 - ${{ env.OUT_DIR }}/${{ env.GRASS }}.tar.gz.sha256 - ${{ env.OUT_DIR }}/${{ env.GRASS }}.tar.xz - ${{ env.OUT_DIR }}/${{ env.GRASS }}.tar.xz.md5 - ${{ env.OUT_DIR }}/${{ env.GRASS }}.tar.xz.sha256 - ${{ env.OUT_DIR }}/ChangeLog.gz - ${{ env.OUT_DIR }}/core_modules_with_last_commit.patch diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index 6b2ad83629e..00000000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,87 +0,0 @@ ---- -name: Docker - -# This workflow builds and pushes docker images to dockerhub -# -# Summary -# -# job docker-os-matrix: -# * creates tags -alpine, -debian and -ubuntu for each release -# * creates tags -alpine, -debian and -ubuntu for all triggered branches -# * creates tags current-alpine, current-debian and current-ubuntu for releasebranch_8_3 -# * creates tag latest for last stable release with ubuntu os - -on: - push: - branches: - - main - - releasebranch_* - - '!releasebranch_7_*' - # tags: ['*.*.*'] - paths-ignore: [doc/**] - release: - types: [published] - -jobs: - - # Run for push to configured branches and all published releases. - # Take care of different os. - # For main branch, created tags are: - # main-alpine, main-debian, main-ubuntu - # For releasebranch_8_3, created tags are: - # current-alpine, current-debian, current-ubuntu, - # releasebranch_8_3-alpine, releasebranch_8_3-debian, releasebranch_8_3-ubuntu - # For a release, e.g. 8.3.0, created tags are: - # 8.3.0-alpine, 8.3.0-debian, 8.3.0-ubuntu and latest (with ubuntu) - docker-os-matrix: - name: build and push ${{ matrix.os }} for ${{ github.ref }} - if: github.repository_owner == 'OSGeo' - runs-on: ubuntu-latest - - strategy: - matrix: - os: - - alpine - - debian - - ubuntu - - ubuntu_wxgui - fail-fast: false - - steps: - - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - fetch-depth: 0 - - name: Docker meta - id: meta - uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 - with: - images: osgeo/grass-gis - tags: | - type=ref,event=tag - type=ref,event=branch - type=raw,value=current,enable=${{ github.ref == format('refs/heads/{0}', 'releasebranch_8_3') }} - type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/8.3') && matrix.os == 'ubuntu' }},suffix= - flavor: | - latest=false - suffix=-${{ matrix.os }} - - name: Set up QEMU - uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1 - - name: Login to DockerHub - uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push - id: docker_build - uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0 - with: - push: true - pull: true - context: . - tags: ${{ steps.meta.outputs.tags }} - file: docker/${{ matrix.os }}/Dockerfile - - name: Image digest - run: echo ${{ steps.docker_build.outputs.digest }} diff --git a/.github/workflows/gcc.yml b/.github/workflows/gcc.yml deleted file mode 100644 index 6b6286ef3f0..00000000000 --- a/.github/workflows/gcc.yml +++ /dev/null @@ -1,59 +0,0 @@ ---- -name: GCC C/C++ standards check - -on: - push: - branches: - - main - - releasebranch_* - pull_request: - -jobs: - build: - name: ${{ matrix.c }} & ${{ matrix.cpp }} - - concurrency: - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}-${{ - matrix.c }}-${{ matrix.cpp }} - cancel-in-progress: true - - runs-on: ubuntu-22.04 - strategy: - matrix: - include: - - c: gnu17 - cpp: c++17 - fail-fast: false - - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Get dependencies - run: | - sudo apt-get update -y - sudo apt-get install -y wget git gawk findutils - xargs -a <(awk '! /^ *(#|$)/' ".github/workflows/apt.txt") -r -- \ - sudo apt-get install -y --no-install-recommends --no-install-suggests - - name: Create installation directory - run: | - mkdir $HOME/install - - name: Ensure one core for compilation - run: | - echo "MAKEFLAGS=-j1" >> $GITHUB_ENV - - name: Set LD_LIBRARY_PATH for compilation - run: | - echo "LD_LIBRARY_PATH=$HOME/install/lib" >> $GITHUB_ENV - - name: Print build environment variables - shell: bash -el {0} - run: | - printenv | sort - gcc --version - ldd --version - - name: Build - env: - # TODO: -pedantic-errors here won't go through ./configure (with GNU C) - CFLAGS: -std=${{ matrix.c }} -fPIC -Wall -Wextra - # TODO: -pedantic-errors here won't compile - CXXFLAGS: -std=${{ matrix.cpp }} -fPIC -Wall -Wextra - run: | - .github/workflows/build_ubuntu-22.04.sh $HOME/install \ - -isystem/usr/include/gdal -Wpedantic -Werror diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml deleted file mode 100644 index f1f9bb9130a..00000000000 --- a/.github/workflows/label.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -name: Pull Request Labeler - -# This workflow will triage pull requests and apply a label based on the -# paths that are modified in the pull request. -# -# To use this workflow, you will need to set up a .github/labeler.yml -# file with configuration. For more information, see: -# https://github.com/actions/labeler/blob/master/README.md - -on: - - pull_request_target - -permissions: {} - -concurrency: - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.sha }} - cancel-in-progress: true - -jobs: - labeler: - permissions: - contents: read - pull-requests: write - runs-on: ubuntu-latest - steps: - - uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0 - with: - sync-labels: false diff --git a/.github/workflows/milestones.yml b/.github/workflows/milestones.yml deleted file mode 100644 index e2ade4eb091..00000000000 --- a/.github/workflows/milestones.yml +++ /dev/null @@ -1,70 +0,0 @@ ---- -name: Assign Milestone - -on: - pull_request_target: - types: [closed] - -jobs: - assign-milestone: - runs-on: ubuntu-latest - if: github.event.pull_request.merged - steps: - # Retreiving the current milestoone from API instead of github context, - # so up-to-date information is used when running after being queued or for reruns - # Otherwise, the information should be available using - # ${{ github.event.pull_request.milestone.title }} - - name: Get current milestone title - id: current-milestone - run: | - echo "milestone<> "${GITHUB_OUTPUT}" - gh pr view ${{ github.event.pull_request.html_url }} --json milestone \ - --jq .milestone.title >> "${GITHUB_OUTPUT}" - echo 'EOF' >> "${GITHUB_OUTPUT}" - env: - GH_TOKEN: ${{ github.token }} - GH_REPO: ${{ github.repository }} - - name: PR already has a milestone - run: echo "PR already has a milestone" - if: ${{ steps.current-milestone.outputs.milestone }} - - name: PR does not have a milestone - run: echo "PR does not have a milestone" - if: ${{ !steps.current-milestone.outputs.milestone }} - - name: Get VERSION file - if: ${{ !steps.current-milestone.outputs.milestone }} - id: version-file - run: | - echo "version<> "${GITHUB_OUTPUT}" - gh api \ - -H "Accept: application/vnd.github.raw" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - "/repos/{owner}/{repo}/contents/include/VERSION?ref=${{ github.sha }}" >> "${GITHUB_OUTPUT}" - echo "EOF" >> "${GITHUB_OUTPUT}" - env: - GH_TOKEN: ${{ github.token }} - GH_REPO: ${{ github.repository }} - - name: Show version file - if: ${{ !steps.current-milestone.outputs.milestone }} - run: echo "${VERSIONFILE}" - env: - VERSIONFILE: ${{ steps.version-file.outputs.version }} - - name: Get milestone title from VERSION file - if: ${{ !steps.current-milestone.outputs.milestone }} - id: milestone - run: | - version=$(echo "$VERSIONFILE" | head -n 3 | xargs | sed 's/ /./g; s/\(RC[0-9]*\|dev\)//g') - echo "title=$version" >> "${GITHUB_OUTPUT}" - env: - VERSIONFILE: ${{ steps.version-file.outputs.version }} - - name: Show milestone title - if: ${{ !steps.current-milestone.outputs.milestone }} - run: echo "${MILESTONE}" - env: - MILESTONE: ${{ steps.milestone.outputs.title }} - - name: Set PR milestone - if: ${{ !steps.current-milestone.outputs.milestone }} - run: gh pr edit ${{ github.event.pull_request.html_url }} --milestone "${MILESTONE}" - env: - GH_TOKEN: ${{ github.token }} - GH_REPO: ${{ github.repository }} - MILESTONE: ${{ steps.milestone.outputs.title }} diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index 30add8dde09..f18001ed7af 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -105,15 +105,15 @@ jobs: - name: Install pytest plugins run: python -m pip install pytest-timeout shell: cmd /D /E:ON /V:OFF /S /C "CALL C:/OSGeo4W/OSGeo4W.bat "{0}"" - - name: Run pytest with a single worker - run: | - call %OSGEO4W_ROOT%\opt\grass\etc\env.bat - set PYTHONPATH=%GISBASE%\etc\python;%PYTHONPATH% - path %GISBASE%\lib;%GISBASE%\bin;%PATH% - pytest --verbose --color=yes ^ - --durations=0 --durations-min=0.5 ^ - -ra . - shell: cmd /D /E:ON /V:OFF /S /C "CALL C:/OSGeo4W/OSGeo4W.bat "{0}"" + # - name: Run pytest with a single worker + # run: | + # call %OSGEO4W_ROOT%\opt\grass\etc\env.bat + # set PYTHONPATH=%GISBASE%\etc\python;%PYTHONPATH% + # path %GISBASE%\lib;%GISBASE%\bin;%PATH% + # pytest --verbose --color=yes ^ + # --durations=0 --durations-min=0.5 ^ + # -ra . + # shell: cmd /D /E:ON /V:OFF /S /C "CALL C:/OSGeo4W/OSGeo4W.bat "{0}"" - name: Run tests run: .github/workflows/test_thorough.bat 'C:\OSGeo4W\opt\grass\grass85.bat' 'C:\OSGeo4W\bin\python3' diff --git a/.github/workflows/periodic_update.yml b/.github/workflows/periodic_update.yml deleted file mode 100644 index d27b8664c55..00000000000 --- a/.github/workflows/periodic_update.yml +++ /dev/null @@ -1,51 +0,0 @@ ---- -name: Periodic update - -# Controls when the action will run. Workflow runs when manually triggered using the UI -# or API, or on a schedule. -on: - workflow_dispatch: - schedule: - # At 10:32 on every first Wednesday of the month. - # See https://crontab.guru/#32_10_*/100,1-7_*_WED - - cron: "32 10 */100,1-7 * WED" - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - update-configure: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - - name: Create URL to the run output - id: vars - run: echo "run-url=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_OUTPUT - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: "Check that autoconf scripts are up-to-date:" - run: | - rm -f config.guess config.sub - wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess && chmod +x config.guess - wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub && chmod +x config.sub - # Display changes, only to follow along in the logs. - - run: git diff -- config.guess config.sub - - name: Double check if files are modified - run: git status --ignored - - name: Create Pull Request - id: cpr - uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5 - with: - commit-message: "config.guess + config.sub: updated from http://git.savannah.gnu.org/cgit/config.git/plain/" - branch: periodic/update-configure - title: "configure: update to latest config.guess and config.sub" - body: | - This updates config.guess and config.sub to their latest versions. - If the two files are deleted in this PR, please check the logs of the workflow here: - [Workflow run summary](${{ steps.vars.outputs.run-url }}) - - Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action - - name: Check outputs - if: ${{ steps.cpr.outputs.pull-request-number }} - run: | - echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" - echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" diff --git a/.github/workflows/post-pr-reviews.yml b/.github/workflows/post-pr-reviews.yml deleted file mode 100644 index afd9726ee34..00000000000 --- a/.github/workflows/post-pr-reviews.yml +++ /dev/null @@ -1,104 +0,0 @@ ---- -name: Post PR code suggestions - -on: - workflow_run: - workflows: ["ClangFormat Check", "Python Code Quality"] - types: - - completed -permissions: {} -jobs: - post-suggestions: - runs-on: ubuntu-latest - # Only run on failures, since no changes are needed on success - if: > - (github.event.workflow_run.event == 'pull_request' && - github.event.workflow_run.conclusion == 'failure') - permissions: - pull-requests: write - steps: - - name: Create a .git directory needed by reviewdog - run: git init - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - id: diff - continue-on-error: true - with: - name: diff - github-token: ${{ github.token }} - run-id: ${{github.event.workflow_run.id }} - - uses: reviewdog/action-setup@3f401fe1d58fe77e10d665ab713057375e39b887 # v1.3.0 - - name: Check what tools have suggestions to post - # Using this pattern to have expected file names explicitly named - id: tools - run: | - for tool_name in $INPUT_TOOL_NAMES - do - INPUT_TOOL_NAME_FILE="diff-${tool_name}.patch" - echo "Checking if tool ${tool_name} left suggestions in ${INPUT_TOOL_NAME_FILE}..." - if [[ -f "${INPUT_TOOL_NAME_FILE}" ]]; then - echo " ${INPUT_TOOL_NAME_FILE} was found for tool ${tool_name}" - echo "$tool_name=true" >> "${GITHUB_OUTPUT}" - else - echo " ${INPUT_TOOL_NAME_FILE} was not found for tool ${tool_name}" - echo "$tool_name=false" >> "${GITHUB_OUTPUT}" - fi - done - env: - INPUT_TOOL_NAMES: >- - black - clang-format - ruff - - name: Post Black suggestions - if: ${{ steps.tools.outputs.black == 'true' }} - run: | - TMPFILE="diff-${INPUT_TOOL_NAME}.patch" - GITHUB_ACTIONS="" reviewdog \ - -name="${INPUT_TOOL_NAME:-reviewdog-suggester}" \ - -f=diff \ - -f.diff.strip=1 \ - -filter-mode=nofilter \ - -guess \ - -reporter="github-pr-review" < "${TMPFILE}" - env: - INPUT_TOOL_NAME: black - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CI_COMMIT: ${{ github.event.workflow_run.head_sha }} - CI_REPO_OWNER: ${{ github.event.workflow_run.repository.owner.login }} - CI_REPO_NAME: ${{ github.event.workflow_run.repository.name }} - # CI_PULL_REQUEST: "" # Populated from reviewdog's "-guess" flag since hard to get - - name: Post ClangFormat suggestions - if: ${{ steps.tools.outputs.clang-format == 'true' }} - run: | - TMPFILE="diff-${INPUT_TOOL_NAME}.patch" - GITHUB_ACTIONS="" reviewdog \ - -name="${INPUT_TOOL_NAME:-reviewdog-suggester}" \ - -f=diff \ - -f.diff.strip=1 \ - -filter-mode=nofilter \ - -guess \ - -reporter="github-pr-review" < "${TMPFILE}" - env: - INPUT_TOOL_NAME: clang-format - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CI_COMMIT: ${{ github.event.workflow_run.head_sha }} - CI_REPO_OWNER: ${{ github.event.workflow_run.repository.owner.login }} - CI_REPO_NAME: ${{ github.event.workflow_run.repository.name }} - # CI_PULL_REQUEST: "" # Populated from reviewdog's "-guess" flag since hard to get - - name: Post Ruff suggestions - if: ${{ steps.tools.outputs.ruff == 'true' }} - run: | - TMPFILE="diff-${INPUT_TOOL_NAME}.patch" - GITHUB_ACTIONS="" reviewdog \ - -name="${INPUT_TOOL_NAME:-reviewdog-suggester}" \ - -f=diff \ - -f.diff.strip=1 \ - -filter-mode=nofilter \ - -guess \ - -reporter="github-pr-review" < "${TMPFILE}" - env: - INPUT_TOOL_NAME: ruff - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CI_COMMIT: ${{ github.event.workflow_run.head_sha }} - CI_REPO_OWNER: ${{ github.event.workflow_run.repository.owner.login }} - CI_REPO_NAME: ${{ github.event.workflow_run.repository.name }} - # CI_PULL_REQUEST: "" # Populated from reviewdog's "-guess" flag since hard to get diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml deleted file mode 100644 index 3fea65773ce..00000000000 --- a/.github/workflows/pytest.yml +++ /dev/null @@ -1,139 +0,0 @@ ---- -name: pytest - -on: - push: - branches: - - main - - releasebranch_* - pull_request: - -jobs: - pytest: - concurrency: - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}-${{ - matrix.os }}-${{ matrix.python-version }} - cancel-in-progress: true - - strategy: - matrix: - os: - - ubuntu-22.04 - python-version: - - '3.9' - - '3.12' - - '3.13' - fail-fast: true - - runs-on: ${{ matrix.os }} - env: - FORCE_COLOR: 1 # for software including pip: https://force-color.org/ - CLICOLOR_FORCE: 1 # for other software including ninja: https://bixense.com/clicolors/ - PYTHONWARNINGS: always - - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - name: Set up Python - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 - with: - python-version: ${{ matrix.python-version }} - cache: pip - allow-prereleases: true - - - name: Install non-Python dependencies - run: | - sudo apt-get update -y - sudo apt-get install -y wget git gawk findutils - xargs -a <(awk '! /^ *(#|$)/' ".github/workflows/apt.txt") -r -- \ - sudo apt-get install -y --no-install-recommends --no-install-suggests - - - uses: rui314/setup-mold@b015f7e3f2938ad3a5ed6e5111a8c6c7c1d6db6e # v1 - - - name: Install Python dependencies - run: | - python -m pip install --upgrade pip - pip install -r .github/workflows/python_requirements.txt - pip install -r .github/workflows/optional_requirements.txt - pip install pytest pytest-timeout pytest-github-actions-annotate-failures pytest-xdist pytest-cov - - - name: Create installation directory - run: | - mkdir $HOME/install - - - name: Set number of cores for compilation - run: | - echo "MAKEFLAGS=-j$(nproc)" >> $GITHUB_ENV - - - name: Build - run: .github/workflows/build_${{ matrix.os }}.sh $HOME/install - - - name: Add the bin directory to PATH - run: | - echo "$HOME/install/bin" >> $GITHUB_PATH - - - name: Print installed versions - if: always() - run: .github/workflows/print_versions.sh - - - name: Test executing of the grass command - run: .github/workflows/test_simple.sh - - - name: Run pytest with multiple workers in parallel - run: | - export PYTHONPATH=`grass --config python_path`:$PYTHONPATH - export LD_LIBRARY_PATH=$(grass --config path)/lib:$LD_LIBRARY_PATH - export INITIAL_GISBASE="$(grass --config path)" - export INITIAL_PWD="${PWD}" - pytest --verbose --color=yes --durations=0 --durations-min=0.5 \ - --numprocesses auto \ - --cov \ - --cov-context=test \ - -ra . \ - -m 'not needs_solo_run' - - - name: Run pytest with a single worker (for tests marked with needs_solo_run) - run: | - export PYTHONPATH=`grass --config python_path`:$PYTHONPATH - export LD_LIBRARY_PATH=$(grass --config path)/lib:$LD_LIBRARY_PATH - export INITIAL_GISBASE="$(grass --config path)" - export INITIAL_PWD="${PWD}" - pytest --verbose --color=yes --durations=0 --durations-min=0.5 \ - --cov \ - --cov-context=test \ - --cov-append \ - -ra . \ - -m 'needs_solo_run' - - name: Fix non-standard installed script paths in coverage data - run: | - export PYTHONPATH=`grass --config python_path`:$PYTHONPATH - export LD_LIBRARY_PATH=$(grass --config path)/lib:$LD_LIBRARY_PATH - export INITIAL_GISBASE="$(grass --config path)" - export INITIAL_PWD="${PWD}" - python utils/coverage_mapper.py - coverage combine - coverage html - - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0 - with: - verbose: true - flags: pytest-python-${{ matrix.python-version }} - name: pytest-python-${{ matrix.python-version }} - token: ${{ secrets.CODECOV_TOKEN }} - - name: Make python-only code coverage test report available - if: ${{ !cancelled() }} - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: python-codecoverage-report-${{ matrix.os }}-${{ matrix.python-version }} - path: coverage_html_report - retention-days: 1 - - pytest-success: - name: pytest Result - needs: - - pytest - if: ${{ always() }} - uses: ./.github/workflows/verify-success.yml - with: - needs_context: ${{ toJson(needs) }} diff --git a/.github/workflows/python-code-quality.yml b/.github/workflows/python-code-quality.yml deleted file mode 100644 index f7f741a7bb1..00000000000 --- a/.github/workflows/python-code-quality.yml +++ /dev/null @@ -1,217 +0,0 @@ ---- -name: Python Code Quality - -on: - push: - branches: - - main - - releasebranch_* - pull_request: - -jobs: - python-checks: - name: Python Code Quality Checks - - concurrency: - group: ${{ github.workflow }}-${{ github.job }}-${{ - github.event_name == 'pull_request' && - github.head_ref || github.sha }} - cancel-in-progress: true - - strategy: - matrix: - include: - - os: ubuntu-22.04 - - env: - # renovate: datasource=python-version depName=python - PYTHON_VERSION: "3.10" - MIN_PYTHON_VERSION: "3.8" - # renovate: datasource=pypi depName=black - BLACK_VERSION: "24.10.0" - # renovate: datasource=pypi depName=flake8 - FLAKE8_VERSION: "7.1.1" - # renovate: datasource=pypi depName=pylint - PYLINT_VERSION: "2.12.2" - # renovate: datasource=pypi depName=bandit - BANDIT_VERSION: "1.7.10" - # renovate: datasource=pypi depName=ruff - RUFF_VERSION: "0.7.2" - - runs-on: ${{ matrix.os }} - permissions: - security-events: write - - steps: - - name: Versions - run: | - echo OS: ${{ matrix.os }} - echo Python: ${{ env.PYTHON_VERSION }} - echo Minimal Python version: ${{ env.MIN_PYTHON_VERSION }} - echo Black: ${{ env.BLACK_VERSION }} - echo Flake8: ${{ env.FLAKE8_VERSION }} - echo Pylint: ${{ env.PYLINT_VERSION }} - echo Bandit: ${{ env.BANDIT_VERSION }} - echo Ruff: ${{ env.RUFF_VERSION }} - - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - name: Set up Python - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 - with: - python-version: ${{ env.PYTHON_VERSION }} - cache: pip - - name: Upgrade pip - run: python -m pip install --upgrade pip - - - name: Install Ruff - run: pip install ruff==${{ env.RUFF_VERSION }} - - name: Run Ruff (output annotations on fixable errors) - run: ruff check --output-format=github . --preview --unsafe-fixes - continue-on-error: true - - name: Run Ruff (apply fixes for suggestions) - run: ruff check . --preview --fix --unsafe-fixes - - name: Create and uploads code suggestions to apply for Ruff - # Will fail fast here if there are changes required - id: diff-ruff - # To run after ruff step exits with failure when rules don't have fixes available - if: ${{ !cancelled() }} - uses: ./.github/actions/create-upload-suggestions - with: - tool-name: ruff - # To keep repo's file structure in formatted changes artifact - extra-upload-changes: pyproject.toml - - - name: Install Black only - run: pip install black[jupyter]==${{ env.BLACK_VERSION }} - - - name: Run Black - run: black . - - - name: Create and uploads code suggestions to apply for Black - # Will fail fast here if there are changes required - id: diff-black - uses: ./.github/actions/create-upload-suggestions - with: - tool-name: black - # To keep repo's file structure in formatted changes artifact - extra-upload-changes: .clang-format - - - name: Install non-Python dependencies - run: | - sudo apt-get update -y - sudo apt-get install -y wget git gawk findutils - xargs -a <(awk '! /^ *(#|$)/' ".github/workflows/apt.txt") -r -- \ - sudo apt-get install -y --no-install-recommends --no-install-suggests - - - name: Install Python dependencies - run: | - pip install -r .github/workflows/python_requirements.txt - pip install -r .github/workflows/optional_requirements.txt - pip install --user pipx - pipx ensurepath - pipx install flake8==${{ env.FLAKE8_VERSION }} - pipx install pylint==${{ env.PYLINT_VERSION }} - pipx inject pylint -r .github/workflows/python_requirements.txt -r .github/workflows/optional_requirements.txt - # The extra toml is only needed before Python 3.11 - pipx install bandit[sarif,toml]==${{ env.BANDIT_VERSION }} - - - name: Run Flake8 - run: | - flake8 --count --statistics --show-source --jobs=$(nproc) . - - - name: Run Flake8 on additional files - run: | - flake8 --count --statistics --show-source --jobs=$(nproc) python/grass/{script,jupyter}/testsuite/ - - - name: Bandit Vulnerability Scan - run: | - bandit -c pyproject.toml -iii -r . -f sarif -o bandit.sarif --exit-zero - - - name: Upload Bandit Scan Results - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: bandit.sarif - path: bandit.sarif - - - name: Upload SARIF File into Security Tab - uses: github/codeql-action/upload-sarif@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0 - with: - sarif_file: bandit.sarif - - - name: Create installation directory - run: | - mkdir $HOME/install - - - name: Set number of cores for compilation - run: | - echo "MAKEFLAGS=-j$(nproc)" >> $GITHUB_ENV - - - uses: rui314/setup-mold@b015f7e3f2938ad3a5ed6e5111a8c6c7c1d6db6e # v1 - - name: Build - run: .github/workflows/build_${{ matrix.os }}.sh $HOME/install - - - name: Add the bin directory to PATH - run: | - echo "$HOME/install/bin" >> $GITHUB_PATH - - - name: Run Pylint on grass package - run: | - export PYTHONPATH=`grass --config python_path`:$PYTHONPATH - export LD_LIBRARY_PATH=$(grass --config path)/lib:$LD_LIBRARY_PATH - cd python - pylint --persistent=no --py-version=${{ env.MIN_PYTHON_VERSION }} --jobs=$(nproc) grass - - - name: Run Pylint on wxGUI - run: | - export PYTHONPATH=`grass --config python_path`:$PYTHONPATH - export LD_LIBRARY_PATH=$(grass --config path)/lib:$LD_LIBRARY_PATH - cd gui/wxpython - pylint --persistent=no --py-version=${{ env.MIN_PYTHON_VERSION }} --jobs=$(nproc) * - - - name: Run Pylint on other files using pytest - run: | - pipx inject --include-apps pylint pytest==7.4.4 - pipx inject pylint pytest-pylint==0.19 pytest-github-actions-annotate-failures - echo "::warning file=.github/workflows/python-code-quality.yml,line=149,col=42,endColumn=48::\ - Temporarily downgraded pytest-pylint and pytest to allow merging other PRs.\ - The errors reported with a newer version seem legitimite and should be fixed \ - (2023-10-18, see https://github.com/OSGeo/grass/pull/3205)\ - (2024-01-28, see https://github.com/OSGeo/grass/issues/3380)" - export PYTHONPATH=`grass --config python_path`:$PYTHONPATH - export LD_LIBRARY_PATH=$(grass --config path)/lib:$LD_LIBRARY_PATH - pytest --pylint -m pylint --pylint-rcfile=.pylintrc --pylint-jobs=$(nproc) \ - --pylint-ignore-patterns="${{ env.PylintIgnore }}" - env: - PylintIgnore: "python/.*,gui/wxpython/.*,doc/.*,man/.*,utils/.*,locale/.*,raster/.*,\ - imagery/.*,scripts/r.in.wms/wms_drv.py,scripts/g.extension/g.extension.py,\ - temporal/t.rast.accdetect/t.rast.accdetect.py,temporal/t.rast.accumulate/t.rast.accumulate.py,\ - scripts/d.rast.edit/d.rast.edit.py" - - - name: Test compiling example modules - run: | - ( cd doc/raster/r.example/ && make ) - ( cd doc/vector/v.example/ && make ) - - - name: Run Sphinx to check API documentation build - run: | - pip install sphinx - make sphinxdoclib - ARCH=$(cat include/Make/Platform.make | grep ^ARCH | cut -d'=' -f2 | xargs) - cp -rp dist.$ARCH/docs/html/libpython sphinx-grass - - - name: Make Sphinx documentation available - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: sphinx-grass - path: sphinx-grass - retention-days: 3 - - python-success: - name: Python Code Quality Result - needs: - - python-checks - if: ${{ always() }} - uses: ./.github/workflows/verify-success.yml - with: - needs_context: ${{ toJson(needs) }} diff --git a/.github/workflows/super-linter.yml b/.github/workflows/super-linter.yml deleted file mode 100644 index ab2168cd1a3..00000000000 --- a/.github/workflows/super-linter.yml +++ /dev/null @@ -1,60 +0,0 @@ ---- -name: General linting - -on: - push: - branches: - - main - - releasebranch_* - pull_request: - -concurrency: - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} - cancel-in-progress: true - -jobs: - super-linter: - name: GitHub Super Linter - - runs-on: ubuntu-latest - - permissions: - contents: read - packages: read - # To report GitHub Actions status checks - statuses: write - - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - # super-linter needs the full git history to get the - # list of files that changed across commits - fetch-depth: 0 - - name: Lint code base - uses: super-linter/super-linter/slim@b92721f792f381cedc002ecdbb9847a15ece5bb8 # v7.1.0 - env: - DEFAULT_BRANCH: main - # To report GitHub Actions status checks - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # By default, super-linter expect all linters to have their config - # files inside .github/linters. - # Setting it to the root of the repo for easier configuration here. - LINTER_RULES_PATH: . - # Listed but commented out linters would be nice to have. - # (see https://github.com/github/super-linter#environment-variables) - # - # Python (supported using Pylint) and C/C++ (not supported) are - # handled separately due to the complexity of the settings. - # VALIDATE_BASH: true - VALIDATE_BASH_EXEC: true - # VALIDATE_CSS: true - # VALIDATE_DOCKER: true - VALIDATE_JAVASCRIPT_ES: true - # VALIDATE_JAVASCRIPT_STANDARD: true - VALIDATE_JSON: true - VALIDATE_MARKDOWN: true - VALIDATE_POWERSHELL: true - # VALIDATE_XML: true - VALIDATE_YAML: true - MARKDOWN_CONFIG_FILE: .markdownlint.yml - YAML_CONFIG_FILE: .yamllint diff --git a/.github/workflows/test-nix.yml b/.github/workflows/test-nix.yml deleted file mode 100644 index 6ce1285de9f..00000000000 --- a/.github/workflows/test-nix.yml +++ /dev/null @@ -1,46 +0,0 @@ ---- -name: Nix package and environment - -on: - schedule: - - cron: '0 1 * * 1' - push: - tags: - - '*' - pull_request: - paths: - - 'flake.nix' - - 'flake.lock' - - 'package.nix' - - '.github/workflows/test-nix.yml' - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} - cancel-in-progress: true - -permissions: {} - -jobs: - test-nix: - runs-on: ubuntu-22.04 - permissions: - contents: read - - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - name: Install nix - uses: DeterminateSystems/nix-installer-action@b92f66560d6f97d6576405a7bae901ab57e72b6a # v15 - - - name: Setup cachix - uses: cachix/cachix-action@ad2ddac53f961de1989924296a1f236fcfbaa4fc # v15 - with: - name: osgeo-grass - authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - - - name: Build package - run: nix build -L --accept-flake-config .#grass - - - name: Test development environment - run: nix develop --accept-flake-config --command echo OK diff --git a/.github/workflows/test_thorough.bat b/.github/workflows/test_thorough.bat index 843adb4c4f0..1db97eefc43 100644 --- a/.github/workflows/test_thorough.bat +++ b/.github/workflows/test_thorough.bat @@ -1,5 +1,7 @@ set grass=%1 set python=%2 -call %grass% --tmp-project XY --exec g.download.project url=https://grass.osgeo.org/sampledata/north_carolina/nc_spm_full_v2alpha2.tar.gz path=%USERPROFILE% -call %grass% --tmp-project XY --exec %python% -m grass.gunittest.main --grassdata %USERPROFILE% --location nc_spm_full_v2alpha2 --location-type nc --min-success 96 --config .github\workflows\osgeo4w_gunittest.cfg +call %grass% --exec g.region s=0 n=90 w=0 e=100 b=0 t=1 rows=3 cols=3 res=10 +call %grass% --exec r.mapcalc expr="a = int(row())" +call %grass% --exec r.colors map=a color=elevation +call %grass% --exec r.colors.out map="a" rules="-" format="json" color_format="hex" diff --git a/.github/workflows/titles.yml b/.github/workflows/titles.yml deleted file mode 100644 index 9821a209a87..00000000000 --- a/.github/workflows/titles.yml +++ /dev/null @@ -1,28 +0,0 @@ ---- -name: Validate Titles - -on: - pull_request_target: - types: - - edited - # The following types are default for pull_request_target - - opened - - synchronize - - reopened - -permissions: {} - -concurrency: - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.sha }} - cancel-in-progress: true - -jobs: - validate-titles: - runs-on: ubuntu-latest - steps: - - name: Checkout base repository (doesn't include the PR changes) - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Call PR title validation function - run: python utils/generate_release_notes.py check "${PR_TITLE}" "" "" - env: - PR_TITLE: ${{ github.event.pull_request.title }} diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml deleted file mode 100644 index 9023df7d1b3..00000000000 --- a/.github/workflows/ubuntu.yml +++ /dev/null @@ -1,165 +0,0 @@ ---- -name: Ubuntu - -# Build and run tests on Ubuntu - -on: - push: - branches: - - main - - releasebranch_* - pull_request: - -jobs: - ubuntu: - concurrency: - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}-${{ - matrix.name }}-${{ matrix.os }}-${{ matrix.extra-include }} - cancel-in-progress: true - - runs-on: ${{ matrix.os }} - env: - PYTHONWARNINGS: always - strategy: - matrix: - name: - - "22.04" - - minimum config - - # Only run tests for these folders in this matrix job. - extra-include: - # All root folders that could contain tests are: - # db display doc docker general gui - # imagery lib misc ps python raster raster3d scripts - # temporal testsuite utils vector visualization - # - # In order to split test executions, all these root folders are - # added as excluded folders, then items included for this matrix - # job are removed from that exclusion list. - # - # Using folded YAML multiline string block chomping (>-) to replace - # newlines with spaces, and strip newline at end. - # See https://yaml-multiline.info/ - - temporal - - >- - db display doc docker general gui - imagery lib misc ps python raster raster3d scripts - testsuite utils vector visualization - - include: - - name: "22.04" - os: ubuntu-22.04 - config: ubuntu-22.04 - # This is without optional things but it still keeps things useful, - # so, e.g., without OpenMP, but with PDAL. Code or tests should be written - # so that test pass even when these optional things are not present. - - name: minimum config - os: ubuntu-22.04 - config: ubuntu-22.04_without_x - fail-fast: false - - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - name: Invert inclusion list to an exclusion list - id: get-exclude - run: | - array=(db display doc docker general gui \ - imagery lib misc ps python raster raster3d scripts \ - temporal testsuite utils vector visualization) - echo "Complete set of folders that can be included:" - echo "${array[@]}" - delete=( ${{ env.DELETE_ARRAY }} ) - echo "Included folders to remove from the complete set:" - echo "${delete[@]}" - for target in "${delete[@]}"; do - for i in "${!array[@]}"; do - if [[ ${array[i]} = $target ]]; then - unset 'array[i]' - fi - done - done - unset new_array - for i in "${!array[@]}"; do - new_array+=( "${array[i]}" ) - done - echo "Excluded folders:" - echo "${new_array[@]}" - printf -v extra_exclude './%s/* ' "${new_array[@]}" - echo "Exclusion string to add to gunittest config" - echo "${extra_exclude}" - echo "extra-exclude=${extra_exclude}" >> "${GITHUB_OUTPUT}" - env: - DELETE_ARRAY: ${{ matrix.extra-include }} - - - name: Add extra exclusions to a gunittest config file - run: | - sed 's:exclude =:exclude = ${{ - steps.get-exclude.outputs.extra-exclude - }}:g' .gunittest.cfg > .gunittest.extra.cfg - cat .gunittest.extra.cfg - - - name: Get dependencies - run: | - sudo apt-get update -y - sudo apt-get install -y wget git gawk findutils - xargs -a <(awk '! /^ *(#|$)/' ".github/workflows/apt.txt") -r -- \ - sudo apt-get install -y --no-install-recommends --no-install-suggests - - - name: Create installation directory - run: | - mkdir $HOME/install - - - name: Set number of cores for compilation - run: | - echo "MAKEFLAGS=-j$(nproc)" >> $GITHUB_ENV - - - name: Set LD_LIBRARY_PATH for compilation - run: | - echo "LD_LIBRARY_PATH=$HOME/install/lib" >> $GITHUB_ENV - - - name: Print build environment variables - shell: bash -el {0} - run: | - printenv | sort - gcc --version - ldd --version - - - name: Build - env: - # TODO: -pedantic-errors here won't go through ./configure (with GNU C) - CFLAGS: -fPIC -Wvla - # TODO: -pedantic-errors here won't compile - CXXFLAGS: -fPIC - run: .github/workflows/build_${{ matrix.config }}.sh $HOME/install -Werror - - - name: Add the bin directory to PATH - run: | - echo "$HOME/install/bin" >> $GITHUB_PATH - - - name: Print installed versions - if: always() - run: .github/workflows/print_versions.sh - - - name: Test executing of the grass command - run: .github/workflows/test_simple.sh - - - name: Run tests - run: .github/workflows/test_thorough.sh --config .gunittest.extra.cfg - - - name: Make HTML test report available - if: ${{ always() }} - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - with: - name: testreport-${{ matrix.os }}-${{ matrix.config }}-${{ matrix.extra-include }} - path: testreport - retention-days: 3 - - build-and-test-success: - name: Build & Test Result - needs: - - ubuntu - if: ${{ always() }} - uses: ./.github/workflows/verify-success.yml - with: - needs_context: ${{ toJson(needs) }} diff --git a/.github/workflows/verify-success.yml b/.github/workflows/verify-success.yml deleted file mode 100644 index 237c239f576..00000000000 --- a/.github/workflows/verify-success.yml +++ /dev/null @@ -1,155 +0,0 @@ ---- -name: Verify Success reusable workflow - -# Use this reusable workflow as a job of workflow to check that -# all jobs, including ones ran through a matrix, were successful. -# This job can then be used as a required status check in the -# repo's rulesets, that allows to change the required jobs or -# the matrix values of a required job without needing to change -# the rulesets settings. In the future, GitHub might have a -# solution to this natively. - -# This reusable workflow has inputs to change what is required -# to have this workflow pass. It handles the cases were there were -# skipped jobs, and no successful jobs. - -# The jobs to check must set as the `needs` for the job calling this -# reusable workflow. This also means that the job ids should be in the -# same workflow file. The calling job must be set to always run to be -# triggered when jobs are skipped or cancelled. -# Then, set the `needs_context` input like: -# `needs_context: ${{ toJson(needs) }}` - -# Example usage, as a job inside a workflow: -# ``` -# jobs: -# a-job-id: -# ... -# another-job-id: -# ... -# some-job-success: -# name: Some Job Result -# needs: -# - a-job-id -# - another-job-id -# if: ${{ always() }} -# uses: ./.github/workflows/verify-success.yml -# with: -# needs_context: ${{ toJson(needs) }} -# ``` - -on: - workflow_call: - inputs: - needs_context: - type: string - required: true - # Can't escape the handlebars in the description - description: - In the calling job that defines all the needed jobs, - send `toJson(needs)` inside `$` followed by `{{ }}` - fail_if_failure: - type: boolean - default: true - description: - If true, this workflow will fail if any job from 'needs_context was - failed - fail_if_cancelled: - type: boolean - default: true - description: - If true, this workflow will fail if any job from 'needs_context' was - cancelled - fail_if_skipped: - type: boolean - default: false - description: - If true, this workflow will fail if any job from 'needs_context' was - skipped - require_success: - type: boolean - default: true - description: - If true, this workflow will fail if no job from 'needs_context' was - successful - -jobs: - verify-success: - name: Success - runs-on: ubuntu-latest - continue-on-error: true - steps: - - name: Set outputs for each job result type - id: has-result - run: | - echo "failure=${{ - contains(env.NEEDS_RESULT, 'failure') }}" >> "$GITHUB_OUTPUT" - echo "cancelled=${{ - contains(env.NEEDS_RESULT, 'cancelled') }}" >> "$GITHUB_OUTPUT" - echo "skipped=${{ - contains(env.NEEDS_RESULT, 'skipped') }}" >> "$GITHUB_OUTPUT" - echo "success=${{ - contains(env.NEEDS_RESULT, 'success') }}" >> "$GITHUB_OUTPUT" - env: - NEEDS_RESULT: ${{ toJson(fromJson(inputs.needs_context).*.result) }} - - name: Set exit codes for each job result type - id: exit-code - run: | - echo "failure=${{ inputs.fail_if_failure && - fromJson(steps.has-result.outputs.failure) && 1 || 0 - }}" >> "$GITHUB_OUTPUT" - echo "cancelled=${{ inputs.fail_if_cancelled && - fromJson(steps.has-result.outputs.cancelled) && 1 || 0 - }}" >> "$GITHUB_OUTPUT" - echo "skipped=${{ inputs.fail_if_skipped && - fromJson(steps.has-result.outputs.skipped) && 1 || 0 - }}" >> "$GITHUB_OUTPUT" - echo "success=${{ inputs.require_success && - !fromJson(steps.has-result.outputs.success) && 1 || 0 - }}" >> "$GITHUB_OUTPUT" - - name: Set messages for each job result type - id: message - run: | - echo "failure=${{ format('{0}{1} were failed', - (steps.exit-code.outputs.failure == 1) && env.P1 || env.P2, - (steps.has-result.outputs.failure == 'true') && env.M1 || env.M2) - }}" >> "$GITHUB_OUTPUT" - echo "cancelled=${{ format('{0}{1} were cancelled', - (steps.exit-code.outputs.cancelled == 1) && env.P1 || env.P2, - (steps.has-result.outputs.cancelled == 'true') && env.M1 || env.M2) - }}" >> "$GITHUB_OUTPUT" - echo "skipped=${{ format('{0}{1} were skipped', - (steps.exit-code.outputs.skipped == 1) && env.P1 || env.P2, - (steps.has-result.outputs.skipped == 'true') && env.M1 || env.M2) - }}" >> "$GITHUB_OUTPUT" - echo "success=${{ format('{0}{1} were successful', - (steps.exit-code.outputs.success == 1) && env.P1 || env.P2, - (steps.has-result.outputs.success == 'true') && env.M1 || env.M2) - }}" >> "$GITHUB_OUTPUT" - env: - P1: "::error ::" # Common message prefix if step will fail - P2: "" # Common message prefix if step will not fail - M1: "Some jobs" # Common message if result is true - M2: "No jobs" # Common message if result is false - - - name: Check for failed jobs - run: | - echo "${{ steps.message.outputs.failure }}" - exit ${{ steps.exit-code.outputs.failure }} - - name: Check for cancelled jobs - run: | - echo "${{ steps.message.outputs.cancelled }}" - exit ${{ steps.exit-code.outputs.cancelled }} - - name: Check for skipped jobs - run: | - echo "${{ steps.message.outputs.skipped }}" - exit ${{ steps.exit-code.outputs.skipped }} - - name: Check for successful jobs - run: | - echo "${{ steps.message.outputs.success }}" - exit ${{ steps.exit-code.outputs.success }} - - - run: echo "Checks passed successfully" - if: ${{ success() }} - - run: echo "Checks failed" - if: ${{ !success() }} diff --git a/vector/v.rectify/v.rectify.html b/vector/v.rectify/v.rectify.html index a90eefef229..5f6ac718fd7 100644 --- a/vector/v.rectify/v.rectify.html +++ b/vector/v.rectify/v.rectify.html @@ -46,11 +46,11 @@

Coordinate transformation and RMSE

The desired order of transformation (1, 2, or 3) is selected with the order option. -If the -r flag is given, v.rectify will calculate the +If the -r flag is given, v.rectify will calculate the Root Mean Square Error (RMSE) and print out statistics in tabular format. -The last row gives a summary with the first column holding the number of -active points, followed by average deviations for each dimension and both -forward and backward transformation and finally forward and backward +The last row gives a summary with the first column holding the number of +active points, followed by average deviations for each dimension and both +forward and backward transformation and finally forward and backward overall RMSE.

2D linear affine transformation (1st order transformation)