From bb0c6cd32f912756c52fc4aef4d270c289f0cced Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Carroll=20=F0=9F=90=99?= Date: Wed, 12 Jun 2024 14:52:08 -0400 Subject: [PATCH] Fix up workflow so it doesn't run the tests twice to produce coverage --- .github/workflows/python-package.yml | 14 +++++--------- .gitignore | 2 ++ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 19e25b90..e854a218 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -33,14 +33,11 @@ jobs: run: | # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest - run: | - pytest test - - name: Calculate coverage - run: coverage run --source=pymdp -m unittest discover test - - name: Generate Coverage HTML + - name: Run tests with pytest, calculating coverage + run: coverage run --source=pymdp -m pytest test/ + - name: Generate coverage HTML report run: coverage html - # expect this to fail when run locally with `act` + # expect actions/upload-artifact@v4 to fail when run locally with `act` - name: Upload Coverage HTML Report for pymdp as a build artifact uses: actions/upload-artifact@v4 with: @@ -48,5 +45,4 @@ jobs: path: htmlcov/ retention-days: 30 - name: Print coverage report to console - run: | - coverage report \ No newline at end of file + run: coverage report \ No newline at end of file diff --git a/.gitignore b/.gitignore index 698fb8ad..61051a2a 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ __pycache__ env/ pymdp.egg-info inferactively_pymdp.egg-info +htmlcov +.coverage