Skip to content

Remove mapskins

Remove mapskins #68

---
name: Additional Checks
# Runs the repository's pre-commit hooks (see .pre-commit-config.yaml) so CI
# enforces exactly what developers run locally. Aligned with the same
# workflow in OSGeo/grass and OSGeo/grass-addons.
on:
push:
branches:
- master
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
permissions: {}
jobs:
additional-checks:
name: Additional checks
runs-on: ubuntu-24.04
permissions:
contents: read
env:
# renovate: datasource=pypi depName=prek
PREK_VERSION: 0.4.6
# renovate: datasource=python-version depName=python
PYTHON_VERSION: "3.14"
steps:
- name: Checkout repository contents
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 31
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install uv and restore its cache
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
with:
enable-cache: false
- name: "Cache pre-commit/prek"
# Not used for releases, only for running pre-commit
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 # zizmor: ignore[cache-poisoning]
with:
path: |-
~/.cache/prek
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Install prek
run: uv tool install "prek@${PREK_VERSION}"
- name: "Run pre-commit/prek for fixes"
run: |
echo '```console' > "$GITHUB_STEP_SUMMARY"
# Enable color output for pre-commit and remove it for the summary
# Use --hook-stage=manual to enable slower pre-commit hooks that are skipped by default
# Skip hooks that produce no fixes, to keep this pass to suggestion-producing hooks
prek run --all-files --show-diff-on-failure --color=always --hook-stage=manual \
--skip actionlint \
--skip yamllint | \
tee >(sed -E 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})*)?[mGK]//g' >> "$GITHUB_STEP_SUMMARY") >&1
exit_code="${PIPESTATUS[0]}"
echo '```' >> "$GITHUB_STEP_SUMMARY"
exit "$exit_code"
- name: Create and uploads code suggestions to apply for pre-commit
# Will fail fast here if there are changes required
id: diff-pre-commit
# To run after pre-commit step exits with failure
if: ${{ !cancelled() }}
uses: OSGeo/grass/.github/actions/create-upload-suggestions@main
with:
tool-name: pre-commit
- name: "Run pre-commit/prek"
run: |
echo '```console' > "$GITHUB_STEP_SUMMARY"
# Enable color output for pre-commit and remove it for the summary
# Use --hook-stage=manual to enable slower pre-commit hooks that are skipped by default
prek run --all-files --show-diff-on-failure --color=always --hook-stage=manual | \
tee >(sed -E 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})*)?[mGK]//g' >> "$GITHUB_STEP_SUMMARY") >&1
exit_code="${PIPESTATUS[0]}"
echo '```' >> "$GITHUB_STEP_SUMMARY"
exit "$exit_code"