Skip to content

Commit

Permalink
Merge pull request MapServer#7009 from rouault/action_coveralls
Browse files Browse the repository at this point in the history
CI: use coverallsapp/github-action@v2
  • Loading branch information
rouault authored Jan 13, 2024
2 parents e9f238d + 574f624 commit 6f649e7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 28 deletions.
29 changes: 12 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,31 @@ jobs:
fail-fast: false
matrix:
include:
- name: Regular
- name: Regular, with coverage
WITH_ASAN: "false"
WITH_COVERAGE: "true"

- name: Address_sanitizer
WITH_ASAN: "true"
WITH_COVERAGE: "false"

name: ${{ matrix.name }}

env:
WITH_ASAN: ${{ matrix.WITH_ASAN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
COVERALLS_SERVICE_NAME: "GitHub Actions"
UPLOAD_COVERALLS: "false"

steps:
- name: Checkout repository contents
uses: actions/checkout@v4

- name: Set RUN_COVERALLS Environment Variable
if: (github.event.pull_request.merged == true || github.event_name == 'push') && env.WITH_ASAN != 'true'
run: |
echo "Setting UPLOAD_COVERALLS to true"
echo "UPLOAD_COVERALLS=true" >>${GITHUB_ENV}
- name: Build
run: |
docker run \
-e WORK_DIR="$PWD" \
-e WITH_ASAN="${{ env.WITH_ASAN }}" \
-e COVERALLS_REPO_TOKEN="${{ env.COVERALLS_REPO_TOKEN }}" \
-e COVERALLS_SERVICE_NAME="${{ env.COVERALLS_SERVICE_NAME }}" \
-e UPLOAD_COVERALLS="${{ env.UPLOAD_COVERALLS }}" \
-e WITH_ASAN="${{ matrix.WITH_ASAN }}" \
-e WITH_COVERAGE="${{ matrix.WITH_COVERAGE }}" \
-v $PWD:$PWD ubuntu:20.04 $PWD/.github/workflows/start.sh
- name: Coveralls
uses: coverallsapp/github-action@v2
if: ${{ matrix.WITH_COVERAGE == 'true' }}
with:
format: lcov
file: mapserver.info
13 changes: 3 additions & 10 deletions ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,7 @@ else
make -j4 test
fi

if "${UPLOAD_COVERALLS:-}" = "true" ]; then
echo "uploading to coveralls"
git config --global --add safe.directory "${WORK_DIR:=..}"
ln -s ../../../src/mapparser.y build/CMakeFiles/mapserver.dir/
ln -s ../../../src/maplexer.l build/CMakeFiles/mapserver.dir/

coveralls --exclude renderers --exclude mapscript --exclude apache --exclude build/mapscript/mapscriptJAVA_wrap.c \
--exclude build/mapscript/mapscriptPYTHON_wrap.c --exclude map2img.c --exclude legend.c --exclude scalebar.c \
--exclude msencrypt.c --exclude sortshp.c --exclude shptreevis.c --exclude shptree.c --exclude testexpr.c \
--exclude testcopy.c --exclude shptreetst.c --exclude tile4ms.c --extension .c --extension .cpp
if [ "${WITH_COVERAGE:-}" = "true" ]; then
lcov --directory . --capture --output-file mapserver.info 2>/dev/null
lcov --remove mapserver.info '/usr/*' --output-file mapserver.info
fi
2 changes: 1 addition & 1 deletion ci/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ which pip
# install Python dependencies (required for msautotests)
pip install --upgrade pip
# pip install cryptography==3.4.6 # avoid requiring rust compiler for the cryptography dependency
pip install cpp-coveralls pyflakes
pip install pyflakes
pip install -r msautotest/requirements.txt

0 comments on commit 6f649e7

Please sign in to comment.