forked from mmbell/samurai
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add CodeCoverage.cmake * add codecoverage option to cmake file * add docker file for code coverage * reorganize the docker folder * fix bugs in the cmake files * update docker image with no shell script * update the CI workflow to add the Codecov checks * reduce the iteration number for the Codecov checks --------- Co-authored-by: Jian Sun <[email protected]>
- Loading branch information
1 parent
475bfbd
commit 544efbe
Showing
6 changed files
with
789 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,44 @@ | ||
name: Samurai CPU test with Beltrami | ||
|
||
on: | ||
workflow_dispatch: | ||
branches: [ "main" ] | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
on: [pull_request, workflow_dispatch] | ||
|
||
jobs: | ||
docker-build-and-test: | ||
name: Build and Test - ${{ matrix.dockerfile }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
dockerfile: | ||
- Dockerfile | ||
- Dockerfile.coverage | ||
steps: | ||
- name: Checkout code from a pull request or push | ||
uses: actions/checkout@v3 | ||
|
||
build_run: | ||
- name: Delete huge unnecessary tools folder | ||
run: rm -rf /opt/hostedtoolcache | ||
|
||
runs-on: ubuntu-latest | ||
- name: Build Docker image | ||
run: docker build -f docker/${{ matrix.dockerfile }} -t samurai . | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build the Docker image | ||
run: docker build . --file Dockerfile --tag samurai_build_run:latest | ||
- name: Running the Docker image for Beltrami case | ||
run: docker run samurai_build_run:latest | ||
# only run this if we are not running codecoverage tests | ||
if: matrix.dockerfile != 'Dockerfile.coverage' | ||
run: docker run --name test-container -t samurai | ||
|
||
- name: Run coverage tests in container | ||
if: matrix.dockerfile == 'Dockerfile.coverage' | ||
run: docker run --name test-container -t samurai make coverage | ||
|
||
- name: Copy coverage from container | ||
if: matrix.dockerfile == 'Dockerfile.coverage' | ||
run: docker cp test-container:/app/samurai/build/coverage.info . | ||
|
||
- name: Upload coverage reports to Codecov | ||
if: matrix.dockerfile == 'Dockerfile.coverage' | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: coverage.info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.