Skip to content

Commit

Permalink
Upload to coveralls.io to work on merged pull requests (MapServer#6997)
Browse files Browse the repository at this point in the history
  • Loading branch information
geographika authored Dec 23, 2023
1 parent f6d1de3 commit 31fcd57
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,24 @@ jobs:
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@v3

- 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 EVENT_NAME="${{ github.event_name }}" \
-e UPLOAD_COVERALLS="${{ env.UPLOAD_COVERALLS }}" \
-v $PWD:$PWD ubuntu:20.04 $PWD/.github/workflows/start.sh
4 changes: 2 additions & 2 deletions ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ if [ "${WITH_ASAN:-}" = "true" ]; then
else
make -j4 test
fi
if [ "${EVENT_NAME:-}" = "push" ] && [ "${WITH_ASAN:-}" != "true" ] && [ -n "${COVERALLS_REPO_TOKEN:-}" ]; then

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/
Expand Down

0 comments on commit 31fcd57

Please sign in to comment.