Skip to content

Commit

Permalink
Use an orb
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomorain committed Jul 2, 2018
1 parent 2bcb180 commit 8f62c79
Showing 1 changed file with 26 additions and 15 deletions.
41 changes: 26 additions & 15 deletions .circleci/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,30 @@

version: 2

orbs:
codecov:
commands:
upload:
parameters:
path:
type: string
steps:
- run:
name: Upload code coverage report to codecov.io
command: |
curl -ivX POST -H 'Accept: text/plain' \
--data-binary @<< parameters.path >> \
"https://codecov.io/upload/v2\
?service=circleci\
&token=$CODECOV_TOKEN\
&commit=$CIRCLE_SHA1\
&branch=$CIRCLE_BRANCH\
&build=$CIRCLE_BUILD_NUM\
&job=$CIRCLE_NODE_INDEX\
&build_url=$CIRCLE_BUILD_URL\
&slug=$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME\
&pr=$CIRCLE_PR_NUMBER"
executors:
go:
docker:
Expand Down Expand Up @@ -39,21 +63,8 @@ jobs:
- store_artifacts:
path: ./coverage.txt
destination: coverage.txt
- run:
name: Upload code coverage report to codecov.io
command: |
curl -ivX POST -H 'Accept: text/plain' \
--data-binary @coverage.txt \
"https://codecov.io/upload/v2\
?service=circleci\
&token=$CODECOV_TOKEN\
&commit=$CIRCLE_SHA1\
&branch=$CIRCLE_BRANCH\
&build=$CIRCLE_BUILD_NUM\
&job=$CIRCLE_NODE_INDEX\
&build_url=$CIRCLE_BUILD_URL\
&slug=$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME\
&pr=$CIRCLE_PR_NUMBER"
- codecov/upload:
path: coverage.txt
lint:
executor: go
steps:
Expand Down

0 comments on commit 8f62c79

Please sign in to comment.