From 33bb2227c27da01e10e680a5dfbd76f075acfd1f Mon Sep 17 00:00:00 2001 From: Emil VATAI Date: Sun, 5 May 2024 21:00:56 +0900 Subject: [PATCH] Add coverage --- .github/workflows/coverage.yaml | 42 +++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/coverage.yaml diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml new file mode 100644 index 0000000..8cab332 --- /dev/null +++ b/.github/workflows/coverage.yaml @@ -0,0 +1,42 @@ +name: Coverage + +on: push +jobs: + run-radicalpy-coverage: + name: Run coverage on RadicalPy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Set up Python "3.11" 🐍 + uses: actions/setup-python@v4 + with: + python-version: "3.11" + cache: 'pip' + - name: Install packages 📦 + run: >- + python -m + pip install -r requirements.txt + - name: Install coverage + run: >- + python -m + pip install coverage + - name: Reset coverage + run: >- + coverage erase + - name: Run coverage + run: >- + coverage run -a python -m + unittest + discover -v + - name: Run examples + run: >- + for file in $(ls examples/*.py); do + PYTHONPATH=. coverage run -a python $file --fast + done + - name: Create report + run: >- + coverage report && coverage xml && ls -lrt + # - name: Code Coverage Report + # uses: irongut/CodeCoverageSummary@v1.3.0 + # with: + # filename: coverage/**/coverage.cobertura.xml