Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Updates CI for GRASS 8.4 #1110

Merged
merged 15 commits into from
Jun 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
237 changes: 0 additions & 237 deletions .github/actions/create-upload-suggestions/action.yml

This file was deleted.

53 changes: 53 additions & 0 deletions .github/workflows/additional_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
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:
- grass[0-9]+
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-latest
env:
# renovate: datasource=python-version depName=python
PYTHON_VERSION: "3.12"

steps:
- name: Checkout repository contents
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
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@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: ${{ env.PYTHON_VERSION }}

- run: pip install pre-commit && pre-commit run -a
if: ${{ steps.changes.outputs.precommit == 'true' }}
15 changes: 9 additions & 6 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,22 @@ concurrency:
cancel-in-progress:
# Do not cancel on protected branches, like grass8
${{ github.ref_protected != true }}
env:
# renovate: datasource=python-version depName=python
PYTHON_VERSION: "3.10"
# renovate: datasource=pypi depName=black
BLACK_VERSION: "24.4.2"
permissions: {}
jobs:
run-black:
name: Black ${{ matrix.black-version }}
name: Black formatting

# Using matrix just to get variables which are not environmental variables
# and also to sync with other workflows which use matrix.
strategy:
matrix:
include:
- os: ubuntu-22.04
python-version: "3.10"
black-version: 24.3.0

runs-on: ${{ matrix.os }}
steps:
Expand All @@ -33,20 +36,20 @@ jobs:
- name: Set up Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ env.PYTHON_VERSION }}
cache: "pip"

- name: Install
run: |
python -m pip install --upgrade pip
pip install black[jupyter]==${{ matrix.black-version }}
pip install black[jupyter]==${{ env.BLACK_VERSION }}

- name: Run Black
run: |
black .
- name: Create and uploads code suggestions to apply
id: diff
uses: ./.github/actions/create-upload-suggestions
uses: OSGeo/grass/.github/actions/create-upload-suggestions@main
with:
tool-name: black
# To keep repo's file structure in formatted changes artifact
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@ jobs:
include:
- grass-version: main
python-version: "3.11"
- grass-version: releasebranch_8_3
- grass-version: releasebranch_8_4
python-version: "3.10"
fail-fast: false

steps:
- name: Checkout core
uses: actions/checkout@v4
uses: actions/checkout@v4 # v4.1.7
with:
repository: OSGeo/grass
ref: ${{ matrix.grass-version }}
path: grass

- name: Checkout addons
uses: actions/checkout@v4
uses: actions/checkout@v4 # v4.1.7
with:
path: grass-addons

Expand All @@ -57,7 +57,7 @@ jobs:
sudo apt-get install -y --no-install-recommends --no-install-suggests

- name: Set up Python ${{ matrix.python-version }} as default Python
uses: actions/setup-python@v5
uses: actions/setup-python@v5 # v5.1.0
with:
python-version: ${{ matrix.python-version }}

Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
pip install -r grass-addons/.github/workflows/extra_requirements.txt

- name: Set up R
uses: r-lib/actions/setup-r@v2
uses: r-lib/actions/setup-r@v2 # v2.9.0
with:
r-version: 4.2.1

Expand All @@ -119,7 +119,7 @@ jobs:
../.github/workflows/test.sh

- name: Make HTML test report available
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v4 # v4.3.3
with:
name: testreport-grass-${{ matrix.grass-version }}-python-${{ matrix.python-version }}
path: grass-addons/src/testreport
Expand Down
Loading
Loading