Skip to content

Commit

Permalink
fix: support carryforward
Browse files Browse the repository at this point in the history
  • Loading branch information
mrexox committed Mar 1, 2023
1 parent c181096 commit 8e1222e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ inputs:
git-commit:
description: 'Override the commit sha'
required: false
debug:
description: 'Enable debug output'
required: false
default: false
outputs:
coveralls-api-result:
description: 'Result status of Coveralls API post.'
Expand All @@ -50,9 +54,11 @@ runs:
- run: coveralls.sh call
shell: bash
env:
COVERALLS__DEBUG: ${{ input.debug }}
COVERALLS__DONE: ${{ input.parallel-finished }}
COVERALLS__BASE_PATH: ${{ input.base-path }}
COVERALLS__FILE: ${{ input.path-to-lcov }}
COVERALLS_CARRYFORWARD_FLAGS: ${{ input.carryforward }}
COVERALLS_FLAG_NAME: ${{ input.flag-name }}
COVERALLS_PARALLEL: ${{ input.parallel }}
COVERALLS_ENDPOINT: ${{ input.coveralls-endpoint }}
Expand Down
21 changes: 15 additions & 6 deletions coveralls.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
#!/usr/bin/env bash

download() {
set -x
# TODO: Determine the download way by RUNNER_OS
curl -L https://coveralls.io/coveralls-linux.tar.gz | tar xz
set +x
[[ "$COVERALLS_DEBUG" == "true" ]] && set -x
if [[ "$RUNNER_OS" == "macOS" ]]
then
brew tap coverallsapp/coveralls
brew install coveralls
elif [[ "$RUNNER_OS" == "Windos" ]]
then
# TODO: Add a step for windows
else
curl -L https://coveralls.io/coveralls-linux.tar.gz | tar xz -C /usr/local/bin
fi
[[ "$COVERALLS_DEBUG" == "true" ]] && set +x
}

call() {
if [[ -n $COVERALLS__DONE ]]; then
./coveralls --done
coveralls --done
else
local args=""
[[ -n $COVERALLS__FILE ]] && args="$args --file $COVERALLS__FILE"
[[ -n $COVERALLS__BASE_PATH ]] && args="$args --base-path $COVERALLS__BASE_PATH"
[[ "$COVERALLS_DEBUG" == "true" ]] && args="$args --debug"

./coveralls $args
coveralls $args
fi
}

Expand Down

0 comments on commit 8e1222e

Please sign in to comment.