Skip to content

Commit

Permalink
Add composite action codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
riemannulus committed Oct 30, 2023
1 parent f795413 commit c83d28b
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/actions/codecov/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: codecov
inputs:
file:
required: false
runs:
using: composite
steps:
- name: restore_cache
uses: actions/[email protected]
with:
key: v1-codecov
path: UPDATE_ME
restore-keys: v1-codecov
- name: Upload a code coverage report file to Codecov.io
run: |-
set -evx
case "$OSTYPE" in
darwin*) plat=macos;;
msys*) plat=windows; suffix=.exe;;
cygwin*) plat=windows; suffix=.exe;;
*) plat=linux;;
esac
mkdir -p _codecov_uploader/$plat/
pushd _codecov_uploader/$plat/
if [[ ! -f "codecov$suffix" ]]; then
curl -OL "https://uploader.codecov.io/latest/$plat/codecov$suffix"
fi
chmod +x "codecov$suffix"
popd
"_codecov_uploader/$plat/codecov$suffix" \
-K \
-f '${{ inputs.file }}' \
-n "$CIRCLE_BUILD_NUM"
shell: bash
if: always()
- name: save_cache
uses: actions/[email protected]
if: always()
with:
path: _codecov_uploader/
key: v1-codecov

0 comments on commit c83d28b

Please sign in to comment.