diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml index 1b7a4665d2f..78a34eff7db 100644 --- a/.github/actionlint.yaml +++ b/.github/actionlint.yaml @@ -16,8 +16,19 @@ config-variables: null # "ignore" is an array of regular expression patterns. Matched error messages # are ignored. This is similar to the "-ignore" command line option. paths: - # .github/workflows/**/*.yml: - # ignore: [] + .github/workflows/**/*.yml: + ignore: + # Remove these ignored errors when actionlint supports `parallel:`, `background:`, `wait:` and `wait-all:` + - 'unexpected key "background" for step to execute action. expected one of' # [syntax-check] + - 'unexpected key "background" for step to run shell command. expected one of' # [syntax-check] + - 'step must run script with "run" section or run action with "uses" section' # [syntax-check] + .github/workflows/python-code-quality.yml: ignore: - 'condition "false" is always evaluated to false. remove the if: section' # [if-cond] + + .github/workflows/osgeo4w.yml: + ignore: + # Remove these ignored errors when actionlint supports `parallel:`, `background:`, `wait:` and `wait-all:` + - 'property "msys2" is not defined in object type {}' # [expression] + - 'property "osgeo4w" is not defined in object type {}' # [expression] diff --git a/.github/workflows/create_release_draft.yml b/.github/workflows/create_release_draft.yml index d0d1182a5dc..6667fafce2f 100644 --- a/.github/workflows/create_release_draft.yml +++ b/.github/workflows/create_release_draft.yml @@ -42,23 +42,24 @@ jobs: - name: Create output directory run: | mkdir "${OUT_DIR}" - - name: Generate ChangeLog file - run: | - python utils/gitlog2changelog.py - mv ChangeLog "${OUT_DIR}/ChangeLog" - gzip "${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 > \ - "${OUT_DIR}/core_modules_with_last_commit.patch" + - parallel: + - name: Generate ChangeLog file + run: | + python utils/gitlog2changelog.py + mv ChangeLog "${OUT_DIR}/ChangeLog" + gzip "${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 > \ + "${OUT_DIR}/core_modules_with_last_commit.patch" - name: Create tarballs (for tags only) if: startsWith(github.ref, 'refs/tags/') run: | diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index d4413ade598..3f8ae5288c1 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -32,13 +32,16 @@ jobs: steps: - name: Checkout core + id: checkout_core uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + background: true with: path: grass fetch-depth: 0 persist-credentials: false - name: Get dependencies + background: true run: | sudo apt-get update -y sudo apt-get install -y wget git gawk findutils \ @@ -52,7 +55,22 @@ jobs: xargs -a <(awk '! /^ *(#|$)/' "grass/.github/workflows/apt.txt") -r -- \ sudo apt-get install -y --no-install-recommends --no-install-suggests + - wait: [checkout_core] + + - name: Checkout addons + id: checkout_addons + background: true + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: OSGeo/grass-addons + ref: grass${{ env.MAJOR }} + path: grass-addons + fetch-depth: 0 + persist-credentials: false + - name: Set up Python (with cache) + id: setup_python_cache + background: true if: ${{ contains(fromJSON('["push", "pull_request"]'), github.event_name) }} uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: @@ -60,11 +78,26 @@ jobs: cache: pip # zizmor: ignore[cache-poisoning] Assuming push event is not used for tags - name: Set up Python (no cache, use for release artifacts) + id: setup_python_nocache + background: true if: ${{ !contains(fromJSON('["push", "pull_request"]'), github.event_name) }} uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: ${{ env.PYTHON_VERSION }} + - wait: [setup_python_cache, setup_python_nocache, checkout_addons] + + - name: Install Python dependencies + background: true + # We install both core and addon dependencies, but we don't install any + # dependencies from the extra list in addons because we don't actually + # run them (and they should be lazy-imported). + run: | + pip install -r grass/.github/workflows/python_requirements.txt + pip install -r grass-addons/.github/workflows/requirements.txt + + - wait-all: + - name: Set version variables run: | cd grass || exit @@ -76,15 +109,6 @@ jobs: echo "YEAR=${YEAR}" } >> "${GITHUB_ENV}" - - name: Checkout addons - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - repository: OSGeo/grass-addons - ref: grass${{ env.MAJOR }} - path: grass-addons - fetch-depth: 0 - persist-credentials: false - - name: ccache (do not use for release artifacts) uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23 if: ${{ contains(fromJSON('["push", "pull_request"]'), github.event_name) }} @@ -94,14 +118,6 @@ jobs: evict-old-files: 7d key: ${{ github.workflow }}-${{ github.job }}-grass${{ env.MAJOR }}-${{ env.PYTHON_VERSION }} - - name: Install Python dependencies - # We install both core and addon dependencies, but we don't install any - # dependencies from the extra list in addons because we don't actually - # run them (and they should be lazy-imported). - run: | - pip install -r grass/.github/workflows/python_requirements.txt - pip install -r grass-addons/.github/workflows/requirements.txt - - uses: rui314/setup-mold@7e4f20ad28a2e8ca6fd0892ccf72e2abb706b9c3 # v1 if: ${{ contains(fromJSON('["push", "pull_request"]'), github.event_name) }} @@ -160,11 +176,28 @@ jobs: run: ./grass/.github/workflows/test_simple.sh - name: Build Programmer's Manual with doxygen + id: build_doxygen + background: true run: | cd grass make htmldocs + - name: Compile addons + id: build_addons + background: true + run: | + ./grass-addons/utils/cronjobs_osgeo_lxd/compile_addons_git.sh \ + "${MAJOR}" \ + "${MINOR}" \ + "$(pwd)/grass-addons/src" \ + "$(grass --config path)" \ + "$(pwd)/addons-build-dir" \ + grass + + - wait: [build_doxygen] + - name: Make the doxygen results available (html) + if: ${{ !cancelled() }} uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: doxygen-site @@ -176,6 +209,7 @@ jobs: retention-days: 15 - name: Make the doxygen results available (latex) + if: ${{ !cancelled() }} uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: doxygen-site-latex @@ -185,20 +219,13 @@ jobs: !grass/latex/**.map !grass/latex/**.md5 retention-days: 15 - - name: Compile addons - run: | - ./grass-addons/utils/cronjobs_osgeo_lxd/compile_addons_git.sh \ - "${MAJOR}" \ - "${MINOR}" \ - "$(pwd)/grass-addons/src" \ - "$(grass --config path)" \ - "$(pwd)/addons-build-dir" \ - grass - name: Get target path for Markdown files run: | echo MKDOCS_DIR="$(grass --config path)/docs/mkdocs" >> "$GITHUB_ENV" + - wait: [build_addons] + - name: Move from build to target directory run: | mkdir "${MKDOCS_DIR}/source/addons" @@ -229,6 +256,7 @@ jobs: pip install -r "grass/man/mkdocs/requirements.txt" - name: Run mkdocs + background: true run: | cd grass || exit eval "$(./utils/update_version.py status --bash)" @@ -239,6 +267,7 @@ jobs: mkdocs build - name: Build Sphinx documentation + background: true run: | pip install -r "grass/python/grass/docs/requirements.txt" cd grass || exit @@ -246,6 +275,8 @@ jobs: ARCH="$(grass --config arch)" mv -v dist."${ARCH}/docs/html/libpython" "${MKDOCS_DIR}/site" + - wait-all: + - name: Merge Sphinx and MkDocs Sitemaps run: | cd grass || exit diff --git a/.github/workflows/gcc.yml b/.github/workflows/gcc.yml index 4ece3373766..b56258f4a93 100644 --- a/.github/workflows/gcc.yml +++ b/.github/workflows/gcc.yml @@ -30,9 +30,11 @@ jobs: steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + background: true with: persist-credentials: false - name: Get dependencies + background: true run: | sudo apt-get update -y sudo apt-get install -y wget git gawk findutils @@ -49,6 +51,7 @@ jobs: - name: Set LD_LIBRARY_PATH for compilation run: | echo "LD_LIBRARY_PATH=${HOME}/install/lib" >> "${GITHUB_ENV}" + - wait-all: - name: Print build environment variables shell: bash -el {0} run: | diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index 96b5a6bb9aa..61c628d53ea 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -30,73 +30,74 @@ jobs: fail-fast: false steps: - - name: Set git to use LF - run: | - git config --global core.autocrlf false - git config --global core.eol lf - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - uses: msys2/setup-msys2@66cd2cce69caa17b53920067426061ca1de3a884 # v2.32.0 - id: msys2 - with: - path-type: inherit - location: D:\ - update: true - msystem: MINGW64 - install: >- - bison - diffutils - dos2unix - flex - git - libintl - make - tar - zip - pacboy: >- - bzip2 - ccache - fftw - gcc - gettext - libiconv - libsystre - libtre - libwinpthread-git - openblas - pcre - pkgconf - toolchain - zlib - - - name: Setup OSGeo4W environment - uses: echoix/setup-OSGeo4W@1e711832882e03603e9013181a87885b10af8a98 # v0.3.0 - id: osgeo4w - with: - package-dir: "D:/OSGeo4W_pkg" - packages: | - cairo-devel - freetype-devel - gdal-devel - geos-devel - libjpeg-turbo-devel - liblas-devel - libpng-devel - libpq-devel - libtiff-devel - netcdf-devel - proj-devel - python3-core - python3-gdal - python3-jupyter - python3-matplotlib - python3-numpy - python3-pip - python3-pywin32 - python3-wxpython - sqlite3-devel - zstd-devel + - parallel: + - name: Set git to use LF + run: | + git config --global core.autocrlf false + git config --global core.eol lf + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: msys2/setup-msys2@66cd2cce69caa17b53920067426061ca1de3a884 # v2.32.0 + id: msys2 + with: + path-type: inherit + location: D:\ + update: true + msystem: MINGW64 + install: >- + bison + diffutils + dos2unix + flex + git + libintl + make + tar + zip + pacboy: >- + bzip2 + ccache + fftw + gcc + gettext + libiconv + libsystre + libtre + libwinpthread-git + openblas + pcre + pkgconf + toolchain + zlib + + - name: Setup OSGeo4W environment + uses: echoix/setup-OSGeo4W@1e711832882e03603e9013181a87885b10af8a98 # v0.3.0 + id: osgeo4w + with: + package-dir: "D:/OSGeo4W_pkg" + packages: | + cairo-devel + freetype-devel + gdal-devel + geos-devel + libjpeg-turbo-devel + liblas-devel + libpng-devel + libpq-devel + libtiff-devel + netcdf-devel + proj-devel + python3-core + python3-gdal + python3-jupyter + python3-matplotlib + python3-numpy + python3-pip + python3-pywin32 + python3-wxpython + sqlite3-devel + zstd-devel - name: Set number of cores for compilation run: | diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index bfd8d77b693..376c2ca3d08 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -37,8 +37,9 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - - name: Set up Python + id: setup_python + background: true uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: ${{ matrix.python-version }} @@ -46,6 +47,7 @@ jobs: allow-prereleases: true - name: Install non-Python dependencies + background: true run: | sudo apt-get update -y sudo apt-get install -y wget git gawk findutils @@ -55,6 +57,9 @@ jobs: sudo apt-get install -y --no-install-recommends --no-install-suggests - uses: rui314/setup-mold@7e4f20ad28a2e8ca6fd0892ccf72e2abb706b9c3 # v1 + background: true + + - wait: [setup_python] - name: Install Python dependencies run: | @@ -65,6 +70,8 @@ jobs: pip install --break-system-packages pytest pytest-timeout \ pytest-github-actions-annotate-failures pytest-xdist pytest-cov + - wait-all: + - name: Create installation directory run: | mkdir "${HOME}/install" diff --git a/.github/workflows/super-linter.yml b/.github/workflows/super-linter.yml index cf0b0beb61a..0d2a6e5bf24 100644 --- a/.github/workflows/super-linter.yml +++ b/.github/workflows/super-linter.yml @@ -62,5 +62,6 @@ jobs: VALIDATE_POWERSHELL: true # VALIDATE_XML: true VALIDATE_YAML: true + GITHUB_ACTIONS_CONFIG_FILE: .github/actionlint.yaml MARKDOWN_CONFIG_FILE: .markdownlint.yml YAML_CONFIG_FILE: .yamllint