Skip to content

Commit

Permalink
Merge branch 'main' into r.stats
Browse files Browse the repository at this point in the history
  • Loading branch information
echoix authored Jun 28, 2024
2 parents 3e5025e + 6748067 commit 0c482cb
Show file tree
Hide file tree
Showing 8 changed files with 191 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@31159d49c0d4756269a0940a750801a1ea5d7003 # v6.1.0
uses: docker/build-push-action@15560696de535e4014efeff63c48f16952e52dd1 # v6.2.0
with:
push: true
pull: true
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
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
pip install pytest pytest-timeout pytest-github-actions-annotate-failures pytest-xdist pytest-cov
- name: Create installation directory
run: |
Expand All @@ -70,6 +70,10 @@ jobs:
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

Expand All @@ -86,12 +90,18 @@ jobs:
export PYTHONPATH=`grass --config python_path`:$PYTHONPATH
export LD_LIBRARY_PATH=$(grass --config path)/lib:$LD_LIBRARY_PATH
pytest --verbose --color=yes --durations=0 --durations-min=0.5 \
--cov \
-ra . \
-m 'needs_solo_run'
- name: Print installed versions
if: always()
run: .github/workflows/print_versions.sh
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
with:
verbose: true
flags: pytest-python-${{ matrix.python-version }}
name: pytest-python-${{ matrix.python-version }}
token: ${{ secrets.CODECOV_TOKEN }}

pytest-success:
name: pytest Result
needs:
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/test-nix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: Nix package and environment

on:
schedule:
- cron: '0 1 * * 1'
push:
tags:
- '*'
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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Install nix
uses: DeterminateSystems/nix-installer-action@7993355175c2765e5733dae74f3e0786fe0e5c4f # v12

- 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
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,9 @@ html/
latex/
lib/*/html/
lib/*/latex/

# Ignore code coverage files
*.gcov
*.gcno
*.gcda
.coverage
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,15 @@ cleandistdirs:
cleanscriptstrings:
rm -f locale/scriptstrings/*.c 2>/dev/null

clean: cleandistdirs cleanscriptstrings cleandocs
clean: cleandistdirs cleanscriptstrings cleandocs code-coverage-clean

libsclean: cleandistdirs
$(MAKE) clean-recursive SUBDIRS=$(LIBDIRS)

code-coverage-clean:
-find . -type f \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete
-rm -f .coverage

distclean: clean
-rm -f config.cache config.log config.status config.status.$(ARCH) 2>/dev/null
-rm -f ChangeLog ChangeLog.bak $(ERRORLOG) grass.pc
Expand Down
114 changes: 114 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
---
# When modifying this file, please validate using
# curl -X POST --data-binary @codecov.yml https://codecov.io/validate

coverage:
status:
project:
default:
target: auto # auto compares coverage to the previous base commit
informational: true
patch:
default:
informational: true

# Disable PR comments initially, until it is possible to have the information as a job summary
comment: false

github_checks:
# Until more tests are added, disable GitHub checks annotation when added lines aren't covered by tests
annotations: false

component_management:
individual_components:
- component_id: modules_database # this is an identifier that should not be changed
name: db # this is a display name, and can be changed freely
paths:
- db/**
- lib/db/**
- scripts/db.*/**
- component_id: modules_display
name: display
paths:
- display/**
- lib/display/**
- scripts/d.*/**
- component_id: modules_general
name: general
paths:
- general/**
- scripts/g.*/**
- component_id: gui
name: gui
paths:
- gui/**
- component_id: modules_imagery
name: imagery
paths:
- imagery/**
- lib/imagery/**
- scripts/i.*/**
- component_id: man
name: man
paths:
- man/**
- component_id: modules_misc
name: imagery
paths:
- misc/**
- scripts/m.*/**
- component_id: modules_postscript
name: ps
paths:
- ps/**
- component_id: modules_raster
name: raster
paths:
- raster/**
- lib/raster/**
- scripts/r.*/**
- component_id: modules_raster3d
name: raster3d
paths:
- raster3d/**
- lib/raster3d/**
- scripts/r3.*/**
- component_id: modules_temporal
name: temporal
paths:
- temporal/**
- lib/temporal/**
- scripts/t.*/**
- component_id: modules_vector
name: vector
paths:
- vector/**
- lib/vector/**
- scripts/v.*/**
- component_id: utils
paths:
- utils/**
- component_id: scripts
paths:
- scripts/**
- component_id: library
name: lib
paths:
- lib/**
- component_id: python_pygrass
name: pygrass
paths:
- python/grass/pygrass/**
- component_id: python_gunittest
name: gunittest
paths:
- python/grass/gunittest/**
- component_id: notebooks
name: notebooks (jupyter)
paths:
- python/grass/jupyter/**
- "**/*.ipynb"
- component_id: python_library
name: python library
paths:
- python/grass/**
3 changes: 3 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
description = "GRASS GIS";

nixConfig = {
extra-substituters = [ "https://osgeo-grass.cachix.org" ];
extra-trusted-public-keys = [ "osgeo-grass.cachix.org-1:rLnUl3u0ikSIudZ/oBfTqTL7mb3qwYmfmtuwexPpHjw=" ];

bash-prompt = "\\[\\033[1m\\][grass-dev]\\[\\033\[m\\]\\040\\w >\\040";
};

Expand Down
10 changes: 8 additions & 2 deletions package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,14 @@ stdenv.mkDerivation (finalAttrs: {

src = lib.cleanSourceWith {
src = ./.;
filter = path: type:
! (lib.hasSuffix ".nix" path);
filter = (
path: type: (builtins.all (x: x != baseNameOf path) [
".git"
".github"
"flake.nix"
"package.nix"
])
);
};

nativeBuildInputs = [
Expand Down

0 comments on commit 0c482cb

Please sign in to comment.