From 574f62433189c163fc084a5bd8a446a0eae5de3a Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 13 Jan 2024 12:44:39 +0100 Subject: [PATCH] CI: use coverallsapp/github-action@v2 --- .github/workflows/build.yml | 29 ++++++++++++----------------- ci/build.sh | 13 +++---------- ci/setup.sh | 2 +- 3 files changed, 16 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 273d15032e..4511b81bfe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/ci/build.sh b/ci/build.sh index 930fb5ac0d..a4fa7e4575 100755 --- a/ci/build.sh +++ b/ci/build.sh @@ -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 diff --git a/ci/setup.sh b/ci/setup.sh index f26459f1b7..3f811e61e0 100755 --- a/ci/setup.sh +++ b/ci/setup.sh @@ -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