Skip to content

Commit

Permalink
Trying to add code coverage reporting to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
cmacmackin committed Jun 4, 2024
1 parent fb3b2ee commit 9586d63
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 5 additions & 2 deletions docker/platypus/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand All @@ -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
11 changes: 11 additions & 0 deletions upload-coverage.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9586d63

Please sign in to comment.