diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2792d3b3..07a29e32 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,3 +28,7 @@ jobs: --build-arg build_git_sha=${PRCOMMITSHA:-$GITHUB_SHA} \ --build-arg build_git_repo=${PRREPOSITORY:-$GITHUB_REPOSITORY} \ docker/platypus + - name: UploadCoverage + run: | + ci_env=`bsah <(curl -s https://codecov.io/env)` + docker run $ci_env -e CI=true ci-platypus-ubuntu:latest bash opt/platypus/upload-coverage.sh diff --git a/docker/platypus/Dockerfile b/docker/platypus/Dockerfile index 86ebd142..327c7455 100644 --- a/docker/platypus/Dockerfile +++ b/docker/platypus/Dockerfile @@ -12,6 +12,9 @@ ARG build_git_repo=aurora-multiphysics/platypus # By default we install everything under /opt ARG WORKDIR=opt +# By default, build without code coverage flags +ARG coverage=false + # Get Platypus with Hephaestus RUN cd /$WORKDIR && \ git clone https://github.com/$build_git_repo && \ @@ -32,8 +35,8 @@ RUN cd /$WORKDIR/platypus/contrib/hephaestus/build && \ # Build Platypus RUN cd /$WORKDIR/platypus && \ - make -j$compile_cores + make -j$compile_cores coverage=$coverage # Test Platypus RUN cd /$WORKDIR/platypus && \ - make test + make test linkcoverage=$coverage diff --git a/upload-coverage.sh b/upload-coverage.sh new file mode 100644 index 00000000..3cee8b60 --- /dev/null +++ b/upload-coverage.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import +curl -Os https://cli.codecov.io/latest/linux/codecov +curl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUM +curl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUM.sig +gpg --verify codecov.SHA256SUM.sig codecov.SHA256SUM + +shasum -a 256 -c codecov.SHA256SUM +sudo chmod +x codecov +./codecov --verbose upload-process --fail-on-error