From c83d28be25e905472c248ca0c16f2a7693cbbd40 Mon Sep 17 00:00:00 2001 From: "Lee, Suho" Date: Mon, 30 Oct 2023 15:07:19 +0900 Subject: [PATCH] Add composite action codecov --- .github/actions/codecov/action.yml | 41 ++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/actions/codecov/action.yml diff --git a/.github/actions/codecov/action.yml b/.github/actions/codecov/action.yml new file mode 100644 index 00000000000..f95c5d6bd67 --- /dev/null +++ b/.github/actions/codecov/action.yml @@ -0,0 +1,41 @@ +name: codecov +inputs: + file: + required: false +runs: + using: composite + steps: + - name: restore_cache + uses: actions/cache@v3.3.2 + 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/cache@v3.3.2 + if: always() + with: + path: _codecov_uploader/ + key: v1-codecov \ No newline at end of file