Skip to content

Commit 66b008c

Browse files
committed
chore(test-cover): add codecov
1 parent c4c3c2b commit 66b008c

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

rootfs/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ RUN export DEBIAN_FRONTEND=noninteractive \
4444
&& curl -o /usr/local/bin/kubectl \
4545
-L "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/$(dpkg --print-architecture)/kubectl" \
4646
&& chmod +x /usr/local/bin/kubectl \
47+
&& curl -SL https://cli.codecov.io/latest/$([ $(dpkg --print-architecture) == "arm64" ] && echo linux-arm64 || echo linux)/codecov -o /usr/local/bin/codecov \
48+
&& chmod +x /usr/local/bin/codecov \
4749
&& go env -w GO111MODULE=on \
4850
&& go install github.com/AlekSi/gocov-xml@latest \
4951
&& go install github.com/axw/gocov/gocov@latest \

rootfs/usr/local/bin/test-cover.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ set -euo pipefail
44
IFS=$'\n\t'
55

66
go test --covermode=atomic -coverprofile=coverage.txt ./...
7+
if [[ -n $CODECOV_TOKEN ]]; then
8+
codecov upload-process --plugin=noop -t "$CODECOV_TOKEN"
9+
fi

0 commit comments

Comments
 (0)