From e0897be88e52a47aca3460f53a2005045649bcb8 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Thu, 2 May 2024 17:15:53 +0100 Subject: [PATCH 1/7] Update test.yml - Generate test coverage - Add a step to upload coverage from each job - Add a job to collect and combine coverage after the tests and generate the coverage report - Run the code-lint job before anything else --- .github/workflows/test.yml | 45 +++++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e93d6ce..081e6f4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,10 +13,11 @@ jobs: python-version: [3.6, 3.8] os: [ubuntu-20.04, macos-11, windows-2019] runs-on: ${{ matrix.os }} + needs: code-lint steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install okonomiyaki @@ -25,15 +26,43 @@ jobs: run: python -m pip install -r "dev_requirements.txt" - name: Test with haas run: | - cd tools - python -m haas okonomiyaki - + mkdir testing + cd testing + coverage run -p -m haas okonomiyaki + - name: Upload Coverage info + uses: actions/upload-artifact@v4 + with: + name: coverage-${{matrix.os}}-${{matrix.python-version}} + path: .coverage.* + coverage: + runs-on: ubuntu-latest + needs: tests + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Download coverage artifacts + uses: actions/download-artifact@v4 + with: + pattern: coverage-* + merge-multiple: true + - name: Install coverage + run: pip install coverage + - name: Generate coverage report + run: | + coverage combine + coverage report + coverage html + - name: Upload coverage report + uses: actions/upload-artifact@v4 + with: + name: coverage-report + path: htmlcov/* code-lint: - runs-on: ubuntu-20.04 + runs-on: ubuntu-20,04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python 3.6 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.6 - name: Install flake8 From b35767210c07d75c978c7002388373a944ddf58c Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Thu, 2 May 2024 17:19:05 +0100 Subject: [PATCH 2/7] Update coverage configuration to use relative paths --- .coveragerc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.coveragerc b/.coveragerc index e733aba..e4fe84b 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,5 +1,5 @@ [report] -omit = +omit = */okonomiyaki/bundled/* */okonomiyaki/versions/pep386.py */tests/* @@ -7,3 +7,4 @@ omit = [run] branch = True source = okonomiyaki +relative_files = True From f7b9ca299c042c606f74164671198bdcdd769590 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Thu, 2 May 2024 17:21:00 +0100 Subject: [PATCH 3/7] fix typo in workflow --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 081e6f4..b5571e7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -58,7 +58,7 @@ jobs: name: coverage-report path: htmlcov/* code-lint: - runs-on: ubuntu-20,04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v4 - name: Set up Python 3.6 From 1365e9ed6a7c1fdaacd18cea49ba2e958d8a844b Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Thu, 2 May 2024 17:28:00 +0100 Subject: [PATCH 4/7] fix paths - point to the correct configuration - coverage output is saved inside testing --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b5571e7..ec6f27a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,12 +28,12 @@ jobs: run: | mkdir testing cd testing - coverage run -p -m haas okonomiyaki + coverage run --rcfile=../.coveragerc -p -m haas okonomiyaki - name: Upload Coverage info uses: actions/upload-artifact@v4 with: name: coverage-${{matrix.os}}-${{matrix.python-version}} - path: .coverage.* + path: testing/.coverage.* coverage: runs-on: ubuntu-latest needs: tests From f393e7e4b77278fdcc1e94d969279ca47133986c Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Thu, 2 May 2024 17:31:52 +0100 Subject: [PATCH 5/7] install okonomiyaki in developer mode --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ec6f27a..b4863ea 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,7 +21,7 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Install okonomiyaki - run: python -m pip install . + run: python -m pip install -e . - name: Install test dependencies run: python -m pip install -r "dev_requirements.txt" - name: Test with haas From b4173cb90338d07d8364e383fd0598bf811cc739 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Thu, 2 May 2024 17:40:28 +0100 Subject: [PATCH 6/7] do not use a separate folder to run the tests --- .github/workflows/test.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b4863ea..37b5fea 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,14 +26,12 @@ jobs: run: python -m pip install -r "dev_requirements.txt" - name: Test with haas run: | - mkdir testing - cd testing - coverage run --rcfile=../.coveragerc -p -m haas okonomiyaki + coverage run -p -m haas okonomiyaki - name: Upload Coverage info uses: actions/upload-artifact@v4 with: name: coverage-${{matrix.os}}-${{matrix.python-version}} - path: testing/.coverage.* + path: .coverage.* coverage: runs-on: ubuntu-latest needs: tests From 20f189f96e3b2d56f4103aecccb0af2d4b6d3db1 Mon Sep 17 00:00:00 2001 From: Ioannis Tziakos Date: Thu, 2 May 2024 17:45:17 +0100 Subject: [PATCH 7/7] install okonomiyaki to generate _version.py --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 37b5fea..7018917 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,6 +47,7 @@ jobs: run: pip install coverage - name: Generate coverage report run: | + pip install -e . coverage combine coverage report coverage html