Skip to content

Commit 9f02405

Browse files
Merge branch 'OSGeo:main' into r.random.surface_tests
2 parents 4b7de0f + ea470fa commit 9f02405

File tree

222 files changed

+2761
-2418
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

222 files changed

+2761
-2418
lines changed

.dockerignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ docker
33
!docker/alpine/grass_tests.sh
44
.gitignore
55
.github
6-
.travis
7-
.travis.yml
86
# Do not copy files from previous compilations
97
dist.*
108

.github/labeler.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,7 @@ CI:
8484
- changed-files:
8585
- any-glob-to-any-file:
8686
- .github/**
87-
- .travis/**
8887
- binder/**
89-
- .travis.yml
9088
- renovate.json
9189
- .pre-commit-config.yaml
9290
Windows:

.github/workflows/docker.yml

Lines changed: 99 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,16 @@ on:
1616
branches:
1717
- main
1818
- releasebranch_*
19-
- '!releasebranch_7_*'
19+
- "!releasebranch_7_*"
2020
# tags: ['*.*.*']
2121
paths-ignore: [doc/**]
22+
pull_request:
23+
paths:
24+
- .github/workflows/docker.yml
25+
- Dockerfile
26+
- docker/**
27+
- "!docker/**.md"
28+
workflow_dispatch:
2229
release:
2330
types: [published]
2431

@@ -35,10 +42,17 @@ jobs:
3542
# For a release, e.g. 8.3.0, created tags are:
3643
# 8.3.0-alpine, 8.3.0-debian, 8.3.0-ubuntu and latest (with ubuntu)
3744
docker-os-matrix:
38-
name: build and push ${{ matrix.os }} for ${{ github.ref }}
39-
if: github.repository_owner == 'OSGeo'
45+
name: ${{ matrix.os }} for ${{ github.ref }}
4046
runs-on: ubuntu-latest
41-
47+
concurrency:
48+
group: >-
49+
${{ github.workflow }}-${{ matrix.os }}-${{ github.event_name }}-
50+
${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
51+
# Cancel in progress in pull requests.
52+
# Otherwise, limit to one in progress and one queued for each type.
53+
# Only the latest queued job per event type will be kept, older will be cancelled.
54+
# The already running job will be completed.
55+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
4256
strategy:
4357
matrix:
4458
os:
@@ -49,32 +63,78 @@ jobs:
4963
fail-fast: false
5064

5165
permissions:
66+
attestations: write
5267
contents: read
68+
id-token: write
5369
packages: write
5470

5571
steps:
5672
- name: Checkout
5773
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5874
with:
5975
fetch-depth: 0
76+
- name: Get the latest tag and release branches
77+
id: tag-branch
78+
run: |
79+
# Make sure tags are fetched
80+
git fetch --tags
81+
# Get sorted list of tags, keep the first that has a semver pattern (not RCs)
82+
latest_tag="$(git tag --sort=-v:refname \
83+
| grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' \
84+
| head -n 1)"
85+
latest_rel_branch="$(git branch --all --list 'origin/*' \
86+
--contains "${latest_tag}" --format "%(refname:lstrip=3)")"
87+
echo "latest_tag=${latest_tag}" >> "${GITHUB_OUTPUT}"
88+
echo "latest_tag is: ${latest_tag}"
89+
echo "latest_rel_branch=${latest_rel_branch}" >> "${GITHUB_OUTPUT}"
90+
echo "latest_rel_branch is: ${latest_rel_branch}"
91+
- name: Get enable values for meta step
92+
id: enable
93+
run: |
94+
latest="${{
95+
(github.ref || format('{0}{1}', 'refs/tags/', github.event.release.tag_name))
96+
== format('refs/tags/{0}', steps.tag-branch.outputs.latest_tag)
97+
&& matrix.os == 'ubuntu' }}"
98+
current="${{
99+
( contains(fromJSON('["tag", "release"]'), github.event_name)
100+
&& (github.ref || format('{0}{1}', 'refs/tags/', github.event.release.tag_name))
101+
== format('refs/tags/{0}', steps.tag-branch.outputs.latest_tag)
102+
)
103+
|| github.ref == format('refs/heads/{0}', steps.tag-branch.outputs.latest_rel_branch)
104+
}}"
105+
echo "latest=${latest}" >> "${GITHUB_OUTPUT}"
106+
echo "latest is $latest"
107+
echo "current=${current}" >> "${GITHUB_OUTPUT}"
108+
echo "current is $current"
60109
- name: Docker meta
61110
id: meta
62111
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1
63112
with:
64-
images: osgeo/grass-gis
113+
images: |
114+
name=docker.io/osgeo/grass-gis,enable=${{ github.repository_owner == 'OSGeo'
115+
&& github.event_name != 'pull_request' }}
116+
name=ghcr.io/${{ github.repository }}
65117
tags: |
66118
type=ref,event=tag
67119
type=ref,event=branch
68-
type=raw,value=current,enable=${{ github.ref == format('refs/heads/{0}', 'releasebranch_8_3') }}
69-
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/8.3') && matrix.os == 'ubuntu' }},suffix=
120+
type=ref,event=pr
121+
type=raw,value=current,enable=${{ steps.enable.outputs.current }}
122+
type=raw,value=latest,enable=${{ steps.enable.outputs.latest }},suffix=
70123
flavor: |
71124
latest=false
72125
suffix=-${{ matrix.os }}
73126
- name: Set up QEMU
74127
uses: docker/setup-qemu-action@4574d27a4764455b42196d70a065bc6853246a25 # v3.4.0
75128
- name: Set up Docker Buildx
76129
uses: docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca # v3.9.0
77-
- name: Login to DockerHub
130+
- name: Login to GitHub Container Registry
131+
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
132+
with:
133+
registry: ghcr.io
134+
username: ${{ github.actor }}
135+
password: ${{ secrets.GITHUB_TOKEN }}
136+
- name: Login to Docker Hub
137+
if: ${{ github.repository_owner == 'OSGeo' && github.event_name != 'pull_request' }}
78138
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
79139
with:
80140
username: ${{ secrets.DOCKERHUB_USERNAME }}
@@ -83,10 +143,39 @@ jobs:
83143
id: docker_build
84144
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.0
85145
with:
86-
push: true
87-
pull: true
146+
push: ${{ github.event_name != 'pull_request' }}
88147
context: .
89148
tags: ${{ steps.meta.outputs.tags }}
90149
file: docker/${{ matrix.os }}/Dockerfile
150+
annotations: ${{ steps.meta.outputs.annotations }}
151+
provenance: mode=max
152+
sbom: true
153+
# Don't use cache for releases.
154+
no-cache: ${{ contains(fromJSON('["tag", "release"]'), github.event_name) && true }}
155+
# Don't use gha cache for releases. Cache is not used if `cache-from:` is empty
156+
cache-from: >-
157+
${{ !contains(fromJSON('["tag", "release"]'), github.event_name)
158+
&& format('type=gha,scope={0}', matrix.os) || '' }}
159+
cache-to: type=gha,mode=max,scope=${{ matrix.os }}
91160
- name: Image digest
92161
run: echo ${{ steps.docker_build.outputs.digest }}
162+
- name: Attest docker.io image
163+
uses: actions/attest-build-provenance@520d128f165991a6c774bcb264f323e3d70747f4 # v2.2.0
164+
# If there isn't a digest, an annotation cannot be added
165+
if: >-
166+
${{ github.repository_owner == 'OSGeo' && github.event_name != 'pull_request'
167+
&& steps.docker_build.outputs.digest }}
168+
id: attest
169+
with:
170+
subject-name: docker.io/osgeo/grass-gis
171+
subject-digest: ${{ steps.docker_build.outputs.digest }}
172+
push-to-registry: ${{ github.repository_owner == 'OSGeo' && github.event_name != 'pull_request' }}
173+
- name: Attest ghcr.io image
174+
uses: actions/attest-build-provenance@520d128f165991a6c774bcb264f323e3d70747f4 # v2.2.0
175+
# If there isn't a digest, an annotation cannot be added
176+
if: ${{ steps.docker_build.outputs.digest }}
177+
id: attest-ghcr
178+
with:
179+
subject-name: ghcr.io/${{ github.repository }}
180+
subject-digest: ${{ steps.docker_build.outputs.digest }}
181+
push-to-registry: ${{ github.event_name != 'pull_request' }}
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
---
2+
name: macOS distribute app
3+
4+
# Build and bundle macOS app
5+
6+
on:
7+
workflow_dispatch:
8+
schedule:
9+
# At 07:30 on Thursdays.
10+
# See https://crontab.guru/#30_7_*_*_THU
11+
- cron: "30 7 * * THU"
12+
push:
13+
tags:
14+
- '**'
15+
16+
permissions: {}
17+
18+
env:
19+
KEYCHAIN_PROFILE: notarytool-profile
20+
21+
jobs:
22+
macos_build:
23+
name: macOS distribute
24+
25+
concurrency:
26+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}-${{
27+
matrix.name }}-${{ matrix.os }}
28+
cancel-in-progress: true
29+
30+
runs-on: ${{ matrix.os }}
31+
strategy:
32+
matrix:
33+
name:
34+
- "x86_64"
35+
- "arm64"
36+
include:
37+
- name: "x86_64"
38+
os: macos-13
39+
deployment_target: 10.13
40+
- name: "arm64"
41+
os: macos-14
42+
deployment_target: 11
43+
fail-fast: false
44+
45+
steps:
46+
- name: Info
47+
run: |
48+
echo "macOS version $(sw_vers -productVersion)"
49+
echo "architecture $(uname -a)"
50+
- name: Disabling Spotlight
51+
run: sudo mdutil -a -i off
52+
- name: Uninstalling Homebrew
53+
run: |
54+
echo "Moving directories..."
55+
sudo mkdir /opt/local-off /opt/homebrew-off
56+
test ! -d /usr/local || /usr/bin/sudo /usr/bin/find /usr/local \
57+
-mindepth 1 -maxdepth 1 -type d -print -exec /bin/mv {} \
58+
/opt/local-off/ \;
59+
test ! -d /opt/homebrew || /usr/bin/sudo /usr/bin/find /opt/homebrew \
60+
-mindepth 1 -maxdepth 1 -type d -print -exec /bin/mv {} \
61+
/opt/homebrew-off/ \;
62+
echo "Removing files..."
63+
test ! -d /usr/local || /usr/bin/sudo /usr/bin/find /usr/local \
64+
-mindepth 1 -maxdepth 1 -type f -print -delete
65+
test ! -d /opt/homebrew || /usr/bin/sudo /usr/bin/find /opt/homebrew \
66+
-mindepth 1 -maxdepth 1 -type f -print -delete
67+
# Rehash to forget about the deleted files
68+
hash -r
69+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
70+
- name: Environment info
71+
shell: bash -el {0}
72+
run: |
73+
printenv | sort
74+
75+
- name: Install the Apple certificate and provisioning profile
76+
env:
77+
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
78+
MACOS_PROVISION_PROFILE: ${{ secrets.MACOS_PROVISION_PROFILE }}
79+
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
80+
MACOS_CERTIFICATE_NAME: ${{ secrets.MACOS_CERTIFICATE_NAME }}
81+
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.MACOS_CI_KEYCHAIN_PWD }}
82+
MACOS_NOTARIZATION_APPLE_ID: ${{ secrets.MACOS_NOTARIZATION_APPLE_ID }}
83+
MACOS_NOTARIZATION_TEAM_ID: ${{ secrets.MACOS_NOTARIZATION_TEAM_ID }}
84+
MACOS_NOTARIZATION_PWD: ${{ secrets.MACOS_NOTARIZATION_PWD }}
85+
run: |
86+
CERT="$RUNNER_TEMP/certificate.p12"
87+
INTERMEDIATE_CERT="$RUNNER_TEMP/DeveloperIDG2CA.cer"
88+
89+
curl -o "$INTERMEDIATE_CERT" https://www.apple.com/certificateauthority/DeveloperIDG2CA.cer
90+
91+
echo -n "$MACOS_CERTIFICATE" | base64 --decode -o "$CERT"
92+
echo -n "$MACOS_PROVISION_PROFILE" | base64 --decode -o "$RUNNER_TEMP/embedded.provisionprofile"
93+
94+
security create-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
95+
security default-keychain -s build.keychain
96+
security unlock-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
97+
security set-keychain-settings -t 15000
98+
security import "$INTERMEDIATE_CERT" -k build.keychain -T /usr/bin/codesign
99+
security import "$CERT" -k build.keychain -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign
100+
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$MACOS_CI_KEYCHAIN_PWD" \
101+
build.keychain 1> /dev/null
102+
103+
echo "Create keychain profile"
104+
xcrun notarytool store-credentials "$KEYCHAIN_PROFILE" --apple-id "$MACOS_NOTARIZATION_APPLE_ID"\
105+
--team-id "$MACOS_NOTARIZATION_TEAM_ID" --password "$MACOS_NOTARIZATION_PWD"
106+
107+
- name: Create config file
108+
shell: bash -el {0}
109+
env:
110+
Config: ${HOME}/.config/grass/configure-build-${{ matrix.name }}.sh
111+
MACOS_CERTIFICATE_NAME: ${{ secrets.MACOS_CERTIFICATE_NAME }}
112+
run: |
113+
mkdir -p "${HOME}/.config/grass"
114+
echo sdk=\"$(xcrun --show-sdk-path)\" >> ${{ env.Config }}
115+
echo deployment_target=\"${{ matrix.deployment_target }}\" >> ${{ env.Config }}
116+
echo cs_ident=\"${MACOS_CERTIFICATE_NAME}\" >> ${{ env.Config }}
117+
echo cs_keychain_profile=\"${KEYCHAIN_PROFILE}\" >> ${{ env.Config }}
118+
echo cs_provisionprofile=\"${RUNNER_TEMP}/embedded.provisionprofile\" >> ${{ env.Config }}
119+
120+
- name: Build GRASS GIS app
121+
run: |
122+
./macos/build_grass_app.bash --with-liblas --notarize -o "${{ runner.temp }}"
123+
124+
- name: Upload DMG file as artifact
125+
if: ${{ success() && !cancelled() }}
126+
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
127+
with:
128+
name: ${{ env.DMG_NAME }}
129+
path: ${{ env.DMG_FILE }}
130+
retention-days: 3

.github/workflows/python-code-quality.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ jobs:
3030
PYTHON_VERSION: "3.13"
3131
MIN_PYTHON_VERSION: "3.9"
3232
# renovate: datasource=pypi depName=flake8
33-
FLAKE8_VERSION: "7.1.1"
33+
FLAKE8_VERSION: "7.1.2"
3434
# renovate: datasource=pypi depName=pylint
3535
PYLINT_VERSION: "3.3.4"
3636
# renovate: datasource=pypi depName=bandit
3737
BANDIT_VERSION: "1.8.2"
3838
# renovate: datasource=pypi depName=ruff
39-
RUFF_VERSION: "0.9.5"
39+
RUFF_VERSION: "0.9.6"
4040

4141
runs-on: ${{ matrix.os }}
4242
permissions:

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,15 @@ daag*.s
4444
# notebook helper files
4545
.ipynb_checkpoints
4646

47+
# python environment
48+
venv/
49+
env/
50+
.venv/
51+
.env/
52+
53+
# VSCode Settings
54+
.vscode/
55+
4756
# ignore gunittest helper and result files
4857
testreport/*
4958
testsuite/examples/testreports/

.markdownlint.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,7 @@ fix: true
88
MD041: false # first-line-h1
99

1010
# Errors from .html to .md rename (first step in HTML to Markdown conversion)
11-
no-duplicate-heading: false
12-
heading-increment: false
1311
no-inline-html: false
1412
no-alt-text: false
1513
line-length: false
1614
# The block above this is to be eventually removed.
17-
18-
no-emphasis-as-heading: false
19-
link-fragments: false
20-
no-space-in-links: false

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ repos:
3838
)
3939
- repo: https://github.com/astral-sh/ruff-pre-commit
4040
# Ruff version.
41-
rev: v0.9.5
41+
rev: v0.9.6
4242
hooks:
4343
# Run the linter.
4444
- id: ruff
@@ -50,7 +50,7 @@ repos:
5050
hooks:
5151
- id: markdownlint-fix
5252
- repo: https://github.com/pycqa/flake8
53-
rev: 7.1.1
53+
rev: 7.1.2
5454
hooks:
5555
- id: flake8
5656
exclude: |

0 commit comments

Comments
 (0)