From 49baf0001b29b9d38293969c206ba39df0eaf783 Mon Sep 17 00:00:00 2001 From: Amrasil Date: Wed, 26 Mar 2025 22:10:02 +0100 Subject: [PATCH 01/17] add(feat/OPS-31): code coverage for ci --- .github/workflows/ci.yml | 31 +++++++++++++++++++++++++++++++ senju/__init__.py | 0 2 files changed, 31 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 senju/__init__.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..904d60e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,31 @@ +name: CI # Name of the workflow + +on: + pull_request: + branches: + - devel # Runs only when a pull request targets the 'devel' branch + +jobs: + test: # Defines a job called "test" + runs-on: ubuntu-latest # The job runs on the latest Ubuntu runner + + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Install dependencies + run: pip install -r requirements.txt + + - name: Run tests with coverage + run: pytest --cov=senju --cov-report=xml + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./coverage.xml diff --git a/senju/__init__.py b/senju/__init__.py new file mode 100644 index 0000000..e69de29 From afdc079de13f1bc124e226f30e262849beea1b03 Mon Sep 17 00:00:00 2001 From: Amrasil <134395490+Amrasil@users.noreply.github.com> Date: Wed, 26 Mar 2025 22:17:50 +0100 Subject: [PATCH 02/17] Update ci.yml --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 904d60e..cf7cb9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,8 @@ name: CI # Name of the workflow on: pull_request: branches: - - devel # Runs only when a pull request targets the 'devel' branch + - devel + - master jobs: test: # Defines a job called "test" From 1b571509d07e858d97afd0577d20cdc1baf56986 Mon Sep 17 00:00:00 2001 From: Amrasil Date: Wed, 26 Mar 2025 22:29:09 +0100 Subject: [PATCH 03/17] change(feat/OPS-31): forgot about poetry --- .github/workflows/ci.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d8083ba --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,33 @@ +name: CI # Name of the workflow + +on: + push: + branches: + - devel + - master + - feat/OPS-31 + +jobs: + test: # Defines a job called "test" + runs-on: ubuntu-latest # The job runs on the latest Ubuntu runner + + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Install dependencies + run: poetry install + + - name: Run tests with coverage + run: poetry run coverage run -m pytest + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./coverage.xml From c90914452022a765d1952dd2bdfcbbbcfab61268 Mon Sep 17 00:00:00 2001 From: Amrasil Date: Wed, 26 Mar 2025 22:33:24 +0100 Subject: [PATCH 04/17] change(feat/OPS-31): test for ci using current branch --- .github/workflows/ci.yml | 5 ++--- README.md | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf7cb9a..5fc9e08 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,10 +1,9 @@ name: CI # Name of the workflow on: - pull_request: + push: branches: - - devel - - master + - feat/OPS-31 jobs: test: # Defines a job called "test" diff --git a/README.md b/README.md index 7b716c0..83714ac 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ +![Codecov](https://codecov.io/gh/senju1337/senju/branch/feat/OPS-31/graph/badge.svg) + # senju API / Webservice for Phrases/Words/Kanji/Haiku From 316cfcfaad782fa035d0a5cdba9946c60707bebb Mon Sep 17 00:00:00 2001 From: Amrasil Date: Wed, 26 Mar 2025 22:36:30 +0100 Subject: [PATCH 05/17] change(feat/OPS-31): forgot about poetry --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5fc9e08..05ad581 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,10 +19,10 @@ jobs: python-version: '3.10' - name: Install dependencies - run: pip install -r requirements.txt + run: poetry install - name: Run tests with coverage - run: pytest --cov=senju --cov-report=xml + run: poetry run coverage run -m pytest - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 From 278259940af7af94df5d302ce0aea7f140c7e842 Mon Sep 17 00:00:00 2001 From: Amrasil Date: Wed, 26 Mar 2025 22:39:43 +0100 Subject: [PATCH 06/17] change(feat/OPS-31): added poetry to be installed first --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05ad581..a6a3025 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,8 @@ jobs: uses: actions/setup-python@v4 with: python-version: '3.10' + - name: Poetry + run: pip install poetry - name: Install dependencies run: poetry install From e073704a6b298c706505c8f7bfe6d852f770a2de Mon Sep 17 00:00:00 2001 From: Amrasil Date: Wed, 26 Mar 2025 22:55:21 +0100 Subject: [PATCH 07/17] change(feat/OPS-31): added token to ci.yml and ensurance that coverage.xml is created --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a6a3025..1f6a6cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,8 +26,11 @@ jobs: - name: Run tests with coverage run: poetry run coverage run -m pytest + - name: Generate Coverage Report # Ensure creation of coverage.xml + run: poetry run coverage xml + - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: - token: ${{ secrets.CODECOV_TOKEN }} + token: ${{RELEASE_PLEASE_TOKEN}} file: ./coverage.xml From 0a89a5d58be8c3b1963f3bd8da26e68e80dae6ab Mon Sep 17 00:00:00 2001 From: Amrasil Date: Wed, 26 Mar 2025 22:56:31 +0100 Subject: [PATCH 08/17] change(feat/OPS-31): token --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f6a6cd..a288a37 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,5 +32,5 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: - token: ${{RELEASE_PLEASE_TOKEN}} + token: ${{secrets.RELEASE_PLEASE_TOKEN}} file: ./coverage.xml From 86a67bd2799419f49f828d39781d6040711eb0d3 Mon Sep 17 00:00:00 2001 From: Amrasil Date: Wed, 26 Mar 2025 23:15:26 +0100 Subject: [PATCH 09/17] change(feat/OPS-31): token --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a288a37..a3dd321 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,5 +32,5 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: - token: ${{secrets.RELEASE_PLEASE_TOKEN}} + token: ${{secrets.CODECOV_TOKEN}} file: ./coverage.xml From 612664477ec071ae07dac154c379fe865afda022 Mon Sep 17 00:00:00 2001 From: Amrasil Date: Wed, 26 Mar 2025 23:29:21 +0100 Subject: [PATCH 10/17] change(feat/OPS-31): tci pipeline to add display codecoverage on every push to any branch and on PRs to devel and master --- .github/workflows/ci.yml | 6 +++++- README.md | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a3dd321..4aa473e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,11 @@ name: CI # Name of the workflow on: push: branches: - - feat/OPS-31 + - '*' + pull_request: + branches: + - devel + - master jobs: test: # Defines a job called "test" diff --git a/README.md b/README.md index 83714ac..6eca652 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![Codecov](https://codecov.io/gh/senju1337/senju/branch/feat/OPS-31/graph/badge.svg) +![Codecov](https://codecov.io/gh/senju1337/senju/branch/HEAD/graph/badge.svg) # senju API / Webservice for Phrases/Words/Kanji/Haiku From bf744f40f3b831fd99ee0a298948f333fdb9e3f0 Mon Sep 17 00:00:00 2001 From: Amrasil Date: Wed, 26 Mar 2025 23:33:56 +0100 Subject: [PATCH 11/17] fix(feat/OPS-31): dynamically display code coverage --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6eca652..886e7a8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![Codecov](https://codecov.io/gh/senju1337/senju/branch/HEAD/graph/badge.svg) +[![Codecov](https://codecov.io/gh/senju1337/senju/branch/HEAD/graph/badge.svg)](https://codecov.io/gh/senju1337/senju) # senju API / Webservice for Phrases/Words/Kanji/Haiku From 917c1f548e86860d6fc16f6d99e8d7b649b0284f Mon Sep 17 00:00:00 2001 From: Amrasil Date: Wed, 26 Mar 2025 23:35:34 +0100 Subject: [PATCH 12/17] change(feat/OPS-31): push condition for testing purposes --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4aa473e..5bfd0ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ name: CI # Name of the workflow on: push: branches: - - '*' + - feat/OPS-31 pull_request: branches: - devel From 36f8e1acead82dc4a21ceba7f1668ec28c5b4bcb Mon Sep 17 00:00:00 2001 From: Amrasil Date: Wed, 26 Mar 2025 23:42:35 +0100 Subject: [PATCH 13/17] change(feat/OPS-31): add branch feat/OPS-31 code coverage to readme for testing purposes --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 886e7a8..f6866bc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ [![Codecov](https://codecov.io/gh/senju1337/senju/branch/HEAD/graph/badge.svg)](https://codecov.io/gh/senju1337/senju) + # senju API / Webservice for Phrases/Words/Kanji/Haiku + +[![Codecov](https://codecov.io/gh/senju1337/senju/branch/feat%2FOPS-31/graph/badge.svg)] \ No newline at end of file From 87cb49d88024d9439fd3b8f069cbfb3e0f63d47d Mon Sep 17 00:00:00 2001 From: Amrasil Date: Wed, 26 Mar 2025 23:55:32 +0100 Subject: [PATCH 14/17] change(feat/OPS-31): dynamically displaying the code coverage doesnt work, reverting back to manually display --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index f6866bc..46f692f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,4 @@ -[![Codecov](https://codecov.io/gh/senju1337/senju/branch/HEAD/graph/badge.svg)](https://codecov.io/gh/senju1337/senju) - +[![Codecov](https://codecov.io/gh/senju1337/senju/branch/feat%2FOPS-31/graph/badge.svg)] # senju API / Webservice for Phrases/Words/Kanji/Haiku - -[![Codecov](https://codecov.io/gh/senju1337/senju/branch/feat%2FOPS-31/graph/badge.svg)] \ No newline at end of file From ca7a60decda9a7f96f96254b044685bef00c9a55 Mon Sep 17 00:00:00 2001 From: Amrasil <134395490+Amrasil@users.noreply.github.com> Date: Wed, 26 Mar 2025 23:57:34 +0100 Subject: [PATCH 15/17] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 46f692f..752dc21 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Codecov](https://codecov.io/gh/senju1337/senju/branch/feat%2FOPS-31/graph/badge.svg)] +![Codecov](https://codecov.io/gh/senju1337/senju/branch/feat%2FOPS-31/graph/badge.svg) # senju API / Webservice for Phrases/Words/Kanji/Haiku From b1017f877d626edbb90ff867ed7e246185fd5889 Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Thu, 27 Mar 2025 09:01:04 +0100 Subject: [PATCH 16/17] fix: set codecoverage display to master branch Refs: OPS-31 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 752dc21..8a62376 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![Codecov](https://codecov.io/gh/senju1337/senju/branch/feat%2FOPS-31/graph/badge.svg) +![Codecov](https://codecov.io/gh/senju1337/senju/branch/master/graph/badge.svg) # senju API / Webservice for Phrases/Words/Kanji/Haiku From 6391779d9c1f68d4fa8a421fc1ea211b717925d1 Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Thu, 27 Mar 2025 09:01:51 +0100 Subject: [PATCH 17/17] chore: run codecov ci only on master Refs: OPS-31 --- .github/workflows/ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5bfd0ca..778e75f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,10 +3,6 @@ name: CI # Name of the workflow on: push: branches: - - feat/OPS-31 - pull_request: - branches: - - devel - master jobs: