Skip to content

Commit d5027ed

Browse files
committed
Use the new codecov uploader
The python uploader is now phased out [1] The new uploader is a binary executable for x86-64 (amd64), so there is no simple way of running it for arm64. However, the arm64 build for small tests shouldn't affect coverage anyway (the tests are exactly the same as for amd64), so it is just skipped for now util the uploader supports this arch, see issue [2] CODECOV_TOKEN needs to be used now because of issue [3] 1. https://docs.codecov.com/docs/deprecated-uploader-migration-guide#python-uploader 2. codecov/uploader#523 3. https://community.codecov.com/t/commit-sha-does-not-match-circle-build/4266
1 parent 4df69e2 commit d5027ed

File tree

2 files changed

+29
-22
lines changed

2 files changed

+29
-22
lines changed

.circleci/template.yml

+15-22
Original file line numberDiff line numberDiff line change
@@ -295,24 +295,15 @@ commands:
295295
restore_workspace:
296296
steps:
297297
- attach_workspace: {at: ~/project}
298-
# TODO migrate to a new codecov uploader, see - https://docs.codecov.com/docs/deprecated-uploader-migration-guide#python-uploader
299-
# fetch_coverage_packages:
300-
# steps:
301-
# - run:
302-
# name: Install pip3 and codecov packages
303-
# command: |
304-
# tools/circle-install-packages.sh python3-pip && \
305-
# pip3 install codecov
306-
# run_coverage_analysis:
307-
# steps:
308-
# - fetch_coverage_packages
309-
# - run:
310-
# name: Coverage
311-
# when: on_success
312-
# command: |
313-
# echo "Success!"
314-
# $EXEC ./rebar3 codecov analyze
315-
# codecov --disable=gcov --env PRESET
298+
run_coverage_analysis:
299+
steps:
300+
- run:
301+
name: Coverage
302+
when: on_success
303+
command: |
304+
echo "Success!"
305+
$EXEC ./rebar3 codecov analyze
306+
tools/circle-upload-codecov.sh
316307
run_small_tests:
317308
steps:
318309
- restore_workspace
@@ -324,9 +315,6 @@ commands:
324315
name: Run Small Tests
325316
command: |
326317
$EXEC tools/test.sh -p small_tests -s true -e true
327-
# - run_coverage_analysis
328-
- upload_results_to_aws
329-
- publish_github_comment
330318
run_docker_smoke_test:
331319
steps:
332320
- checkout
@@ -566,6 +554,9 @@ jobs:
566554
SKIP_AUTO_COMPILE: true
567555
steps:
568556
- run_small_tests
557+
- run_coverage_analysis
558+
- upload_results_to_aws
559+
- publish_github_comment
569560

570561
small_tests_in_docker_arm64:
571562
executor: arm64
@@ -585,6 +576,8 @@ jobs:
585576
command: |
586577
docker run -dit --name redis --network host --rm redis:__REDIS_VERSION__
587578
- run_small_tests
579+
- upload_results_to_aws
580+
- publish_github_comment
588581

589582
big_tests_in_docker:
590583
executor: << parameters.executor >>
@@ -651,7 +644,7 @@ jobs:
651644
- store_test_results:
652645
when: always
653646
path: junit_report.xml
654-
# - run_coverage_analysis
647+
- run_coverage_analysis
655648
- run:
656649
name: Build Failed - Logs
657650
when: on_fail

tools/circle-upload-codecov.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
set -eo pipefail
4+
5+
# Source: https://docs.codecov.com/docs/codecov-uploader#integrity-checking-the-uploader
6+
curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import # One-time step
7+
curl -Os https://uploader.codecov.io/latest/linux/codecov
8+
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
9+
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
10+
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
11+
shasum -a 256 -c codecov.SHA256SUM
12+
13+
chmod +x codecov
14+
./codecov -t ${CODECOV_TOKEN} -e PRESET

0 commit comments

Comments
 (0)