From 97dd0017b515656d6cbc710fde8a1adeeb258ace Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Wed, 13 Oct 2021 17:24:14 -0400 Subject: [PATCH] [semver:minor] Add alpine support --- .circleci/config.yml | 27 +++++++++++++++++++++++++++ CHANGELOG.md | 4 ++++ README.md | 2 +- src/@orb.yml | 19 ++++++++++++------- 4 files changed, 44 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bd04f5f5..7e94ef90 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -59,6 +59,27 @@ jobs: root: . paths: - coverage/coverage-final.json + test-codecov-orb-alpine: + docker: + - image: alpine:latest + steps: + - checkout + - attach_workspace: + at: . + - run: | + apk add coreutils curl gnupg + mkdir ~/.gnupg + touch ~/.gnupg/trustedkeys.gpg + - codecov/upload: + flags: backend,alpine + - codecov/upload: + file: coverage/coverage-final.json + flags: frontend,alpine + xtra_args: -v -Z + - codecov/upload: + file: coverage/coverage-final.json + flags: version,alpine + version: v0.1.0_8880 test-codecov-orb-linux: docker: - image: cimg/base:stable @@ -146,6 +167,11 @@ workflows: jobs: - test-backend - test-frontend + - test-codecov-orb-alpine: + requires: + - test-backend + - test-frontend + - test-codecov-orb-linux: requires: - test-backend @@ -172,6 +198,7 @@ workflows: publish-version-tag: false publish-token-variable: ORB_PUBLISH_TOKEN requires: + - test-codecov-orb-alpine - test-codecov-orb-linux - test-codecov-orb-macos - test-codecov-orb-windows diff --git a/CHANGELOG.md b/CHANGELOG.md index ba373ae2..8762006b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.2.0 +**Features** +- #117: feat: Add alpine build support + ## 3.1.1 **Fixes** - #111 fix: xtra_args and file not being parsed properly diff --git a/README.md b/README.md index ad43c386..b4636096 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # codecov-circleci-orb -## Latest version 3.1.1 +## Latest version 3.2.0 [![codecov.io](https://codecov.io/github/codecov/codecov-circleci-orb/coverage.svg?branch=master)](https://codecov.io/github/codecov/codecov-circleci-orb) [![Circle CI](https://circleci.com/gh/codecov/codecov-circleci-orb.png?style=badge)](https://circleci.com/gh/codecov/codecov-circleci-orb) diff --git a/src/@orb.yml b/src/@orb.yml index 39f5db83..40f180a8 100644 --- a/src/@orb.yml +++ b/src/@orb.yml @@ -2,6 +2,8 @@ version: 2.1 description: > Upload your coverage reports to Codecov without dealing with complex configurations. This orb helps you get coverage results quickly so that you can breathe easier and commit your code with confidence. + + If running on `alpine` builds, the orb will need `coreutils`, `curl`, and `gnupg` in order to validate. display: source_url: https://github.com/codecov/codecov-circleci-orb home_url: https://codecov.io/ @@ -48,7 +50,10 @@ commands: family=$(uname -s | tr '[:upper:]' '[:lower:]') os="windows" [[ $family == "darwin" ]] && os="macos" + [[ $family == "linux" ]] && os="linux" + [[ $os == "linux" ]] && osID=$(grep -e "^ID=" /etc/os-release | cut -c4-) + [[ $osID == "alpine" ]] && os="alpine" echo "Detected ${os}" echo "export os=${os}" >> $BASH_ENV @@ -64,22 +69,22 @@ commands: - run: name: Validate Codecov Uploader command: | - curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --import # One-time step + source $BASH_ENV + curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import # One-time step curl -Os "https://uploader.codecov.io/<< parameters.version >>/${os}/${filename}.SHA256SUM" curl -Os "https://uploader.codecov.io/<< parameters.version >>/${os}/${filename}.SHA256SUM.sig" - gpg --verify $filename.SHA256SUM.sig $filename.SHA256SUM + gpgv $filename.SHA256SUM.sig $filename.SHA256SUM shasum -a 256 -c $filename.SHA256SUM || sha256sum -c $filename.SHA256SUM - run: name: Upload Coverage Results command: | + source $BASH_ENV chmod +x $filename - args=() - [[ -n "<< parameters.file >>" ]] && args+=( "-f << parameters.file >>" ) - [[ -n "<< parameters.xtra_args >>" ]] && args+=( "<< parameters.xtra_args >>" ) - curl -H "Accept: application/json" "https://uploader.codecov.io/${os}/<< parameters.version >>" | grep -o '\"version\":\"v[0-9\.\_]\+\"' | head -1 + [ -n "<< parameters.file >>" ] && set - "${@}" "-f" "<< parameters.file >>" + [ -n "<< parameters.xtra_args >>" ] && set - "${@}" "<< parameters.xtra_args >>" ./$filename \ -Q "codecov-circleci-orb-3.1.0" \ -t "${<< parameters.token >>}" \ -n "<< parameters.upload_name >>" \ -F "<< parameters.flags >>" \ - ${args[@]} + ${@}