Skip to content

Commit

Permalink
Merge pull request #117 from codecov/alpine-support
Browse files Browse the repository at this point in the history
[semver:minor] Add alpine support
  • Loading branch information
thomasrockhu-codecov authored Oct 14, 2021
2 parents bfca449 + 97dd001 commit 35a3186
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 8 deletions.
27 changes: 27 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)
19 changes: 12 additions & 7 deletions src/@orb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down Expand Up @@ -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
Expand All @@ -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[@]}
${@}

0 comments on commit 35a3186

Please sign in to comment.