Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
024afdf
CI(macOS): Add Codecov upload step to macOS workflow
echoix Apr 18, 2025
d80d997
CI(macOS): Add pytest-cov to macOS workflow configuration
echoix Apr 18, 2025
93f6ae6
CI(macOS): Add script to fix coverage data paths
echoix Apr 18, 2025
8269d65
DEBUG: show directory info
echoix Apr 18, 2025
55505e1
install coverage
echoix Apr 18, 2025
21979a7
remove trailing space
echoix Apr 18, 2025
c80a32a
CI(macOS): Use micromamba-shell for coverage mapping
echoix Apr 18, 2025
1737b0c
Add artifact upload step for coverage report
echoix Apr 18, 2025
d269f39
CI(macOS): Create json coverage file to upload
echoix Apr 18, 2025
451a00f
Remove redundant flag from codecov upload
echoix Apr 18, 2025
366ea9c
CI(macOS): Update compiler flags for profiling and coverage
echoix Apr 18, 2025
d18e62e
Remove redundant flags from CPPFLAGS in macOS script
echoix Apr 18, 2025
18989fa
Add LDFLAGS for profiling in macOS install script
echoix Apr 18, 2025
3af40e7
Update macOS install script with coverage flags
echoix Apr 18, 2025
9a60029
CI(deps): Update codecov/codecov-action action to v5.4.2
echoix Apr 18, 2025
d261b8b
Update CXXFLAGS and LDFLAGS in macos_install.sh
echoix Apr 19, 2025
1cc3288
CI(macOS): Add `-fprofile-instr-generate` to LDFLAGS
echoix Apr 20, 2025
cfc9a22
CI(macOS): Add EXTRA_COV_FLAGS to CFLAGS and CPPFLAGS
echoix Apr 20, 2025
bc73009
CI(macOS): Add `-fcoverage-mapping` to LDFLAGS
echoix Apr 20, 2025
2619b38
CI(macOS): Move flags before running configure
echoix Apr 20, 2025
cfa8b08
CI(macOS): Sort coverage test dependency
echoix Apr 20, 2025
cf909b9
CI(macOS): Add llvmdev conda package
echoix Apr 20, 2025
bec5287
CI(macOS): Add other llvm conda packages
echoix Apr 20, 2025
bc90f0b
CI(macOS): Remove some superfluous EXTRA_COV_FLAGS
echoix Apr 20, 2025
b19ab42
CI(macOS): Remove coverage flags from C pre-processor flags
echoix Apr 20, 2025
407feb4
CI(macOS): Replace LDFLAGS with LINK_FLAGS as used in makefile
echoix Apr 20, 2025
9868242
CI(macOS): Set LINK_FLAGS to makefile with MY_LINK_FLAGS
echoix Apr 20, 2025
bc816dc
CI(macOS): Do not set LINK_FLAGS to makefile, but export LINK_FLAGS
echoix Apr 20, 2025
5f42b0a
CI(macOS): Export LDFLAGS before running configure
echoix Apr 20, 2025
4d9bc7a
CI(macOS): Set LDFLAGS only for configure
echoix Apr 20, 2025
ef5094f
CI(macOS): Remove trailing space
echoix Apr 20, 2025
9d9da60
CI(macOS): Merge and index raw profile data
echoix Apr 20, 2025
b8915d0
CI(macOS): Add `-sparse` flag to llvm-profdata call
echoix Apr 20, 2025
d4960d9
CI(macOS): Run llvm-profdata in micromamba shell
echoix Apr 20, 2025
204a0ac
CI: print grass --config in print_versions.sh
echoix Apr 20, 2025
f2ccab9
CI: Add directory listings
echoix Apr 20, 2025
7af7e1a
CI: Upload profile data
echoix Apr 20, 2025
2b846f4
CI(macOS): Create a line-oriented coverage report
echoix Apr 20, 2025
2bd8792
CI(macOS): grass is not an object file
echoix Apr 20, 2025
a5371d4
CI(macOS): Comment out llvm-cov call
echoix Apr 21, 2025
6e2f423
CI(macOS): Add find command for object and profile files
echoix Apr 21, 2025
b162a5b
CI(macOS): Add more directory listings
echoix Apr 21, 2025
b4b3c4c
CI(macOS): Quote upload of profile data pattern
echoix Apr 21, 2025
df77a95
CI(macOS): Define LLVM_PROFILE_FILE env var
echoix Apr 21, 2025
4d9544e
CI(macOS): Add find command for profraw and profdata only
echoix Apr 21, 2025
671b7c6
CI(macOS): Define LLVM_PROFILE_FILE env var with absolute path
echoix Apr 21, 2025
cce55f8
CI(macOS): Show merged profile data
echoix Apr 21, 2025
b93c402
CI(macOS): Use relative profile file name
echoix Apr 21, 2025
01417f2
CI(macOS): Export coverage report with llvm-cov export
echoix Apr 21, 2025
8ed0030
CI(macOS): Export coverage for a library
echoix Apr 21, 2025
db3fce0
CI(macOS): Add more patterns to profile data included in artifact upload
echoix Apr 21, 2025
046a99b
CI(macOS): Export coverage format to json
echoix Apr 21, 2025
4b5c04d
CI(macOS): Show and export coverage for all libs with a glob
echoix Apr 21, 2025
3426604
CI(macOS): Upload coverage after export
echoix Apr 21, 2025
0c2cca9
CI(macOS): Export coverage for all libs with a glob in lcov format
echoix Apr 21, 2025
65b5b54
CI(macOS): yaml formatting fix
echoix Apr 21, 2025
ac232a9
CI(macOS): Use absolute profraw files
echoix Apr 21, 2025
6b28338
CI(macOS): yaml formatting fix
echoix Apr 21, 2025
ee4bfb3
CI(macOS): yaml formatting fix
echoix Apr 21, 2025
5d7796c
CI(macOS): Show coverage with color
echoix Apr 21, 2025
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
100 changes: 98 additions & 2 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
runs-on: macos-14
env:
PYTHONWARNINGS: always
# LLVM_PROFILE_FILE: "grass-prof-%9m.profraw"
steps:
- name: Info
run: |
Expand Down Expand Up @@ -55,8 +56,17 @@
- name: Prepare Conda environment file
env:
test_dependencies: |
compiler-rt
coverage
ipython
libllvm20
lit
llvm
llvm-tools
llvm-tools-20
llvmdev
pytest
pytest-cov
pytest-github-actions-annotate-failures
pytest-timeout
pytest-xdist
Expand All @@ -72,7 +82,8 @@
environment-name: grass-env
# Persist on the same period (date).
cache-environment-key: environment-${{ steps.date.outputs.date }}

- name: Set profile file name env var
run: echo "LLVM_PROFILE_FILE=${{ github.workspace }}/grass-prof-%9m.profraw" >> $GITHUB_ENV
- name: Environment info
shell: bash -el {0}
run: |
Expand All @@ -89,7 +100,10 @@
if: ${{ !cancelled() }}
shell: micromamba-shell {0}
run: source ./.github/workflows/print_versions.sh

- run: ls -la bin.*-*-*
- run: ls -la dist.*-*-*/bin
- run: ls -la "$HOME/install"
- run: ls -la "$HOME/install/bin"
- name: Run pytest with multiple workers in parallel
shell: micromamba-shell {0}
run: |
Expand All @@ -104,8 +118,11 @@
run: |
export PYTHONPATH=$(grass --config python_path):$PYTHONPATH
export LD_LIBRARY_PATH=$(grass --config path)/lib:$LD_LIBRARY_PATH
export INITIAL_GISBASE="$(grass --config path)"
export INITIAL_PWD="${PWD}"
pytest \
@.github/workflows/pytest_args_ci.txt \
@.github/workflows/pytest_args_cov.txt \
@.github/workflows/pytest_args_not_parallel.txt \
-k 'not testsuite'
- name: Run pytest with a single worker (for gunittest-based tests)
Expand All @@ -115,6 +132,85 @@
export LD_LIBRARY_PATH=$(grass --config path)/lib:$LD_LIBRARY_PATH
pytest \
@.github/workflows/pytest_args_gunittest.txt
- name: Fix non-standard installed script paths in coverage data
shell: micromamba-shell {0}
run: |
export PYTHONPATH=$(grass --config python_path):$PYTHONPATH
export LD_LIBRARY_PATH=$(grass --config path)/lib:$LD_LIBRARY_PATH
export INITIAL_GISBASE="$(grass --config path)"
export INITIAL_PWD="${PWD}"
python utils/coverage_mapper.py
coverage combine
coverage html
coverage json
- name: Merge and index profile data
shell: micromamba-shell {0}
run: llvm-profdata merge -sparse *.profraw -o merged.profdata
- name: Show merged profile data
shell: micromamba-shell {0}
continue-on-error: true
run: llvm-profdata show merged.profdata
- run: ls -la "$HOME/install"
- run: ls -la "$HOME/install/bin"
- name: Create a line-oriented coverage report
shell: micromamba-shell {0}
continue-on-error: true
run: |
llvm-cov show -use-color -instr-profile=merged.profdata \
/Users/runner/install/grass85/lib/libgrass_gis.8.5.dylib
- name: Create a line-oriented coverage report
shell: micromamba-shell {0}
continue-on-error: true
run: |
llvm-cov show -use-color -instr-profile=merged.profdata \
/Users/runner/install/grass85/lib/*.dylib
- name: Export coverage report with llvm-cov export
if: false
shell: micromamba-shell {0}
continue-on-error: true
run: llvm-cov export -format=text -instr-profile=merged.profdata /Users/runner/install/grass85/lib/libgrass_gis.8.5.dylib | tee coverage.libgrass_gis.json

Check failure on line 171 in .github/workflows/macos.yml

View workflow job for this annotation

GitHub Actions / Additional checks

171:121 [line-length] line too long (162 > 120 characters)
- name: Export coverage report with llvm-cov export
if: false
shell: micromamba-shell {0}
continue-on-error: true
run: llvm-cov export -format=text -instr-profile=merged.profdata /Users/runner/install/grass85/lib/*.dylib | tee coverage.libs.json

Check failure on line 176 in .github/workflows/macos.yml

View workflow job for this annotation

GitHub Actions / Additional checks

176:121 [line-length] line too long (139 > 120 characters)
- name: Export coverage report with llvm-cov export
shell: micromamba-shell {0}
continue-on-error: true
run: llvm-cov export -format=lcov -instr-profile=merged.profdata /Users/runner/install/grass85/lib/*.dylib | tee coverage.libs.lcov

Check failure on line 180 in .github/workflows/macos.yml

View workflow job for this annotation

GitHub Actions / Additional checks

180:121 [line-length] line too long (139 > 120 characters)
- name: Make profile data available
if: ${{ !cancelled() }}
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: >-
profile-data-${{ 'macos-14' }}
path: |
*.prof*
*coverage*
retention-days: 1
- run: /usr/bin/find . -type f \( -name "*.o" -or -name "*.prof*" \)
- run: /usr/bin/find . -type f \( -name "*.profraw" -or -name "*.profdata" \)
- run: /usr/bin/find $HOME/install -type f \( -name "*.o" -or -name "*.prof*" \)
- run: ls -la
- run: ls -la "$HOME/install"
- run: ls -la "$HOME/install/bin"
- run: ls -la -R "$HOME/install"
- run: ls -la -R .
- name: Make python-only code coverage test report available
if: ${{ !cancelled() }}
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: >-
python-codecoverage-report-${{ 'macos-14' }}
path: coverage_html_report
retention-days: 1
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d # v5.4.2
with:
verbose: true
flags: pytest-macos-14
name: pytest-macos-14
token: ${{ secrets.CODECOV_TOKEN }}

- name: Cache GRASS Sample Dataset
id: cached-data
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/macos_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,17 @@ CONFIGURE_FLAGS="\
--without-x \
"

# export EXTRA_COV_FLAGS="-fprofile-instr-generate -fcoverage-mapping -mllvm -runtime-counter-relocation"
export EXTRA_COV_FLAGS="-fprofile-instr-generate -fcoverage-mapping"
export CFLAGS="-O2 -pipe -ffp-contract=off -arch ${CONDA_ARCH} -DGL_SILENCE_DEPRECATION -Wall -Wextra -Wpedantic -Wvla"
export CXXFLAGS="-O2 -pipe -ffp-contract=off -stdlib=libc++ -arch ${CONDA_ARCH} -Wall -Wextra -Wpedantic"
export CPPFLAGS="-isystem${CONDA_PREFIX}/include"

./configure $CONFIGURE_FLAGS
# export LDFLAGS="-v -fprofile-instr-generate -fcoverage-mapping"
export CFLAGS="$EXTRA_COV_FLAGS $CFLAGS"
export CXXFLAGS="$EXTRA_COV_FLAGS $CXXFLAGS"

LDFLAGS="-v -fprofile-instr-generate -fcoverage-mapping $LDFLAGS" ./configure $CONFIGURE_FLAGS

EXEMPT=""
make -j$(sysctl -n hw.ncpu) CFLAGS="$CFLAGS -Werror $EXEMPT" \
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/print_versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ grass --version
grass --tmp-project XY --exec g.version -ergb
# Detailed Python version info (in one line thanks to echo)
grass --tmp-project XY --exec bash -c "echo Python: \$(\$GRASS_PYTHON -c 'import sys; print(sys.version)')"

grass --config
Loading