-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
95 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
|
||
set -eu | ||
|
||
export CXXFLAGS="--coverage" | ||
export CFLAGS="--coverage" | ||
export LDFLAGS="-lgcov" | ||
|
||
cmake ${GDAL_SOURCE_DIR:=..} \ | ||
-DUSE_CCACHE=ON \ | ||
-DCMAKE_BUILD_TYPE=Debug \ | ||
-DCMAKE_INSTALL_PREFIX=/usr \ | ||
-DGDAL_USE_TIFF_INTERNAL=ON \ | ||
-DGDAL_USE_GEOTIFF_INTERNAL=ON \ | ||
-DECW_ROOT=/opt/libecwj2-3.3 \ | ||
-DMRSID_ROOT=/usr/local \ | ||
-DFileGDB_ROOT=/usr/local/FileGDB_API | ||
|
||
make -j$(nproc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
set -eu | ||
|
||
export OGR_HANA_CONNECTION_STRING='DRIVER=/usr/sap/hdbclient/libodbcHDB.so;HOST=917df316-4e01-4a10-be54-eac1b6ab15fb.hana.prod-us10.hanacloud.ondemand.com;PORT=443;USER=GDALCI;PASSWORD=u7t!Ukeugzq7' | ||
|
||
ctest -V -j $(nproc) | ||
|
||
lcov --directory . --capture --output-file gdal.info 2>/dev/null | ||
cp gdal.info gdal_filtered.info | ||
lcov --remove gdal_filtered.info '/usr/*' --output-file gdal_filtered.info | ||
lcov --remove gdal_filtered.info '/opt/*' --output-file gdal_filtered.info | ||
lcov --remove gdal_filtered.info '*jpeg/libjpeg*' --output-file gdal_filtered.info | ||
lcov --remove gdal_filtered.info '*pcraster/libcsf*' --output-file gdal_filtered.info | ||
lcov --remove gdal_filtered.info '*googletest-src*' --output-file gdal_filtered.info | ||
genhtml -o ./coverage_html --ignore-errors source --num-spaces 2 gdal_filtered.info >/dev/null | ||
|
||
if test "${COVERALLS_REPO_TOKEN:-}" != ""; then | ||
pip install cpp-coveralls | ||
echo "Running git config --global --add safe.directory ${GDAL_SOURCE_DIR}" | ||
git config --global --add safe.directory ${GDAL_SOURCE_DIR} | ||
coveralls -n -l gdal_filtered.info | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,7 @@ jobs: | |
GDAL_SOURCE_DIR: /gdal # Directory to which workspace (source root) will be mounted inside container | ||
|
||
permissions: | ||
contents: read | ||
contents: write # for Git to git push | ||
packages: write | ||
|
||
strategy: | ||
|
@@ -84,6 +84,13 @@ jobs: | |
build_script: build.sh | ||
test_script: test.sh | ||
|
||
- name: Ubuntu 20.04, coverage | ||
id: coverage | ||
travis_branch: ubuntu_2004 | ||
container: ubuntu_20.04 | ||
build_script: build.sh | ||
test_script: test.sh | ||
|
||
- name: Ubuntu 20.04, Intel compiler | ||
id: icc | ||
container: icc | ||
|
@@ -248,6 +255,8 @@ jobs: | |
-e GITHUB_WORKFLOW \ | ||
-e TRAVIS \ | ||
-e TRAVIS_BRANCH \ | ||
-e GDAL_SOURCE_DIR \ | ||
-e "COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }}" \ | ||
--security-opt seccomp=unconfined \ | ||
--add-host=host.docker.internal:host-gateway \ | ||
--rm \ | ||
|
@@ -265,3 +274,45 @@ jobs: | |
run: | | ||
docker push ${CONTAINER_NAME_FULL} | ||
- name: Upload coverage artifacts | ||
uses: actions/upload-artifact@v3 | ||
if: ${{ matrix.id == 'coverage' }} | ||
with: | ||
name: coverage_index.html | ||
path: build-${{ matrix.id }}/coverage_html/index.html | ||
|
||
- name: Upload coverage artifacts | ||
uses: actions/upload-artifact@v3 | ||
if: ${{ matrix.id == 'coverage' }} | ||
with: | ||
name: HTML | ||
path: build-${{ matrix.id }}/coverage_html/* | ||
|
||
- name: Deploy ssh key (for coverage) | ||
if: ${{ matrix.id == 'coverage' && github.event_name == 'push' && github.ref_name == 'master' && github.repository == 'OSGeo/gdal' }} | ||
shell: bash -l {0} | ||
run: | | ||
mkdir $HOME/.ssh && echo "${{ secrets.GDAL_TEST_COVERAGE_RESULTS_SSH_KEY }}" > $HOME/.ssh/id_rsa | ||
chmod 700 $HOME/.ssh && chmod 600 $HOME/.ssh/id_rsa | ||
ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts | ||
eval `ssh-agent -s` | ||
ssh-add $HOME/.ssh/id_rsa | ||
- name: Deploy to https://github.com/OSGeo/gdal-test-coverage-results | ||
if: ${{ matrix.id == 'coverage' && github.event_name == 'push' && github.ref_name == 'master' && github.repository == 'OSGeo/gdal' }} | ||
shell: bash -l {0} | ||
run: | | ||
set -x | ||
set -e | ||
mkdir -p output_html/coverage_html | ||
cp -r $GITHUB_WORKSPACE/build-${{ matrix.id }}/coverage_html/* output_html/coverage_html/ | ||
cd output_html | ||
git init | ||
git config user.email "[email protected]" | ||
git config user.name "GDAL test coverage results bot" | ||
git remote add origin [email protected]:gdalautotest-coverage-results/gdalautotest-coverage-results.github.io | ||
git remote -v | ||
echo "Results of coverage of GDAL autotest See https://gdalautotest-coverage-results.github.io/coverage_html/index.html" > README.md | ||
git add -A | ||
git commit -m "Update with OSGeo/gdal commit $GITHUB_SHA" | ||
git push -f origin master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters