From f9466ff5387e02b1487c50a19cc7540b2f4beb6f Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Tue, 11 Jun 2024 10:02:25 -0700 Subject: [PATCH 01/50] Add new github workflows for ruff and poetry --- .github/workflows/poetry-install.yaml | 19 +++++++++++++++++++ .github/workflows/ruff.yml | 8 ++++++++ 2 files changed, 27 insertions(+) create mode 100644 .github/workflows/poetry-install.yaml create mode 100644 .github/workflows/ruff.yml diff --git a/.github/workflows/poetry-install.yaml b/.github/workflows/poetry-install.yaml new file mode 100644 index 0000000..8c60600 --- /dev/null +++ b/.github/workflows/poetry-install.yaml @@ -0,0 +1,19 @@ +name: poetry +on: [push, workflow_dispatch] +env: + POETRY_HOME: /opt/poetry +jobs: + poetry: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install python + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install Poetry + run: | + python3 -m venv POETRY_HOME + $POETRY_HOME/bin/pip install poetry==1.2.0 + - name: Build Artifact + run: $POETRY_HOME/bin/poetry build \ No newline at end of file diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml new file mode 100644 index 0000000..8e10796 --- /dev/null +++ b/.github/workflows/ruff.yml @@ -0,0 +1,8 @@ +name: Ruff +on: [pull_request] +jobs: + ruff: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: chartboost/ruff-action@v1 From 76a28a37ae6477938e525e20c923de0168354f0b Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Tue, 11 Jun 2024 10:04:08 -0700 Subject: [PATCH 02/50] Fix missing $ --- .github/workflows/poetry-install.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/poetry-install.yaml b/.github/workflows/poetry-install.yaml index 8c60600..ebb0b47 100644 --- a/.github/workflows/poetry-install.yaml +++ b/.github/workflows/poetry-install.yaml @@ -13,7 +13,7 @@ jobs: python-version: "3.10" - name: Install Poetry run: | - python3 -m venv POETRY_HOME + python3 -m venv $POETRY_HOME $POETRY_HOME/bin/pip install poetry==1.2.0 - name: Build Artifact run: $POETRY_HOME/bin/poetry build \ No newline at end of file From de960c999580cb6cb35e68386ef1eaaba181c505 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Tue, 11 Jun 2024 10:06:07 -0700 Subject: [PATCH 03/50] Update python version in gh action --- .github/workflows/poetry-install.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/poetry-install.yaml b/.github/workflows/poetry-install.yaml index ebb0b47..ea1c93f 100644 --- a/.github/workflows/poetry-install.yaml +++ b/.github/workflows/poetry-install.yaml @@ -10,7 +10,7 @@ jobs: - name: Install python uses: actions/setup-python@v3 with: - python-version: "3.10" + python-version: "3.12" - name: Install Poetry run: | python3 -m venv $POETRY_HOME From 240516c4f8b95bd2938df7f9ca5865871b0b0657 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Tue, 11 Jun 2024 11:18:03 -0700 Subject: [PATCH 04/50] Add ruff and test functionality --- .github/workflows/poetry-install.yaml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/poetry-install.yaml b/.github/workflows/poetry-install.yaml index ea1c93f..7a16fde 100644 --- a/.github/workflows/poetry-install.yaml +++ b/.github/workflows/poetry-install.yaml @@ -1,19 +1,28 @@ name: poetry -on: [push, workflow_dispatch] +on: [push, pull_request, workflow_dispatch] env: POETRY_HOME: /opt/poetry + POETRY: $POETRY_HOME/bin/poetry jobs: poetry: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: "3.12" - name: Install Poetry run: | python3 -m venv $POETRY_HOME $POETRY_HOME/bin/pip install poetry==1.2.0 - - name: Build Artifact - run: $POETRY_HOME/bin/poetry build \ No newline at end of file + - name: Install dependencies + run: POETRY install + # - name: Build Artifact + # run: $POETRY build + - name: Lint with ruff + uses: chartboost/ruff-action@v1 + continue-on-error: true + - name: Python tests + run: $POETRY run pytest + continue-on-error: true From af72a82a637dfc86877e71d658756a899335820c Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Tue, 11 Jun 2024 11:19:43 -0700 Subject: [PATCH 05/50] Fix $ --- .github/workflows/poetry-install.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/poetry-install.yaml b/.github/workflows/poetry-install.yaml index 7a16fde..e91daad 100644 --- a/.github/workflows/poetry-install.yaml +++ b/.github/workflows/poetry-install.yaml @@ -17,7 +17,7 @@ jobs: python3 -m venv $POETRY_HOME $POETRY_HOME/bin/pip install poetry==1.2.0 - name: Install dependencies - run: POETRY install + run: $POETRY install # - name: Build Artifact # run: $POETRY build - name: Lint with ruff From 614150b960fc1be388aab5397ab49d36bfc9409d Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Tue, 11 Jun 2024 11:21:04 -0700 Subject: [PATCH 06/50] Fix --- .github/workflows/poetry-install.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/poetry-install.yaml b/.github/workflows/poetry-install.yaml index e91daad..651ba28 100644 --- a/.github/workflows/poetry-install.yaml +++ b/.github/workflows/poetry-install.yaml @@ -2,7 +2,7 @@ name: poetry on: [push, pull_request, workflow_dispatch] env: POETRY_HOME: /opt/poetry - POETRY: $POETRY_HOME/bin/poetry + POETRY: $opt/poetry/bin/poetry jobs: poetry: runs-on: ubuntu-latest From 69f8cd694e58daf76382d43a1980ad61aaef4e00 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Tue, 11 Jun 2024 11:21:53 -0700 Subject: [PATCH 07/50] Fix --- .github/workflows/poetry-install.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/poetry-install.yaml b/.github/workflows/poetry-install.yaml index 651ba28..633998b 100644 --- a/.github/workflows/poetry-install.yaml +++ b/.github/workflows/poetry-install.yaml @@ -2,7 +2,7 @@ name: poetry on: [push, pull_request, workflow_dispatch] env: POETRY_HOME: /opt/poetry - POETRY: $opt/poetry/bin/poetry + POETRY: /opt/poetry/bin/poetry jobs: poetry: runs-on: ubuntu-latest From 63030282af20768e41a89d9d1949b1fbf090c974 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Tue, 11 Jun 2024 12:22:27 -0700 Subject: [PATCH 08/50] Test repository variables and sh file --- .github/workflows/poetry-install.yaml | 7 +------ scripts/poetry-install.sh | 3 +++ 2 files changed, 4 insertions(+), 6 deletions(-) create mode 100644 scripts/poetry-install.sh diff --git a/.github/workflows/poetry-install.yaml b/.github/workflows/poetry-install.yaml index 633998b..6dc87f3 100644 --- a/.github/workflows/poetry-install.yaml +++ b/.github/workflows/poetry-install.yaml @@ -1,8 +1,5 @@ name: poetry on: [push, pull_request, workflow_dispatch] -env: - POETRY_HOME: /opt/poetry - POETRY: /opt/poetry/bin/poetry jobs: poetry: runs-on: ubuntu-latest @@ -13,9 +10,7 @@ jobs: with: python-version: "3.12" - name: Install Poetry - run: | - python3 -m venv $POETRY_HOME - $POETRY_HOME/bin/pip install poetry==1.2.0 + run: ./scripts/poetry-install.sh - name: Install dependencies run: $POETRY install # - name: Build Artifact diff --git a/scripts/poetry-install.sh b/scripts/poetry-install.sh new file mode 100644 index 0000000..26b38c9 --- /dev/null +++ b/scripts/poetry-install.sh @@ -0,0 +1,3 @@ +#!/bin/bash +python3 -m venv $POETRY_HOME +$POETRY_HOME/bin/pip install poetry==1.2.0 \ No newline at end of file From c3cab8fe1d2c1b11b043fd9448c9bb0a20871d48 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Tue, 11 Jun 2024 12:25:53 -0700 Subject: [PATCH 09/50] Make script executable --- scripts/poetry-install.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/poetry-install.sh diff --git a/scripts/poetry-install.sh b/scripts/poetry-install.sh old mode 100644 new mode 100755 From 4d4da23f5db734e1597cea78216b240c3b64e258 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Tue, 11 Jun 2024 12:29:12 -0700 Subject: [PATCH 10/50] Test --- .github/workflows/poetry-install.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/poetry-install.yaml b/.github/workflows/poetry-install.yaml index 6dc87f3..b7a490e 100644 --- a/.github/workflows/poetry-install.yaml +++ b/.github/workflows/poetry-install.yaml @@ -12,7 +12,7 @@ jobs: - name: Install Poetry run: ./scripts/poetry-install.sh - name: Install dependencies - run: $POETRY install + run: /opt/poetry/bin/poetry install # - name: Build Artifact # run: $POETRY build - name: Lint with ruff From b944e13f4ad8d73af8f130e43834a896a1e18a3f Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Tue, 11 Jun 2024 12:31:53 -0700 Subject: [PATCH 11/50] TEst 2 --- .github/workflows/poetry-install.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/poetry-install.yaml b/.github/workflows/poetry-install.yaml index b7a490e..b7599c2 100644 --- a/.github/workflows/poetry-install.yaml +++ b/.github/workflows/poetry-install.yaml @@ -10,9 +10,11 @@ jobs: with: python-version: "3.12" - name: Install Poetry - run: ./scripts/poetry-install.sh + run: | + python3 -m venv $POETRY_HOME + $POETRY_HOME/bin/pip install poetry==1.2.0 - name: Install dependencies - run: /opt/poetry/bin/poetry install + run: $POETRY install # - name: Build Artifact # run: $POETRY build - name: Lint with ruff From 11bab4f3714ed51f9c208fe473bcaec2a0fe8638 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Tue, 11 Jun 2024 12:41:14 -0700 Subject: [PATCH 12/50] Test 3 --- .github/workflows/poetry-install.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/poetry-install.yaml b/.github/workflows/poetry-install.yaml index b7599c2..7884fbb 100644 --- a/.github/workflows/poetry-install.yaml +++ b/.github/workflows/poetry-install.yaml @@ -11,8 +11,8 @@ jobs: python-version: "3.12" - name: Install Poetry run: | - python3 -m venv $POETRY_HOME - $POETRY_HOME/bin/pip install poetry==1.2.0 + python3 -m venv ${{vars.POETRY_HOME}} + ${{vars.POETRY_HOME}}/bin/pip install poetry==1.2.0 - name: Install dependencies run: $POETRY install # - name: Build Artifact @@ -21,5 +21,5 @@ jobs: uses: chartboost/ruff-action@v1 continue-on-error: true - name: Python tests - run: $POETRY run pytest + run: ${{vars.POETRY}} run pytest continue-on-error: true From d6a819c9247b761d47058cae1e4af9357cabfb9f Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Tue, 11 Jun 2024 12:43:22 -0700 Subject: [PATCH 13/50] Test 4 --- .github/workflows/poetry-install.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/poetry-install.yaml b/.github/workflows/poetry-install.yaml index 7884fbb..b08b862 100644 --- a/.github/workflows/poetry-install.yaml +++ b/.github/workflows/poetry-install.yaml @@ -14,7 +14,7 @@ jobs: python3 -m venv ${{vars.POETRY_HOME}} ${{vars.POETRY_HOME}}/bin/pip install poetry==1.2.0 - name: Install dependencies - run: $POETRY install + run: ${{vars.POETRY}} install # - name: Build Artifact # run: $POETRY build - name: Lint with ruff From 9b3f3052c3429abcf78df146e13097237feb7ac4 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Tue, 11 Jun 2024 12:51:31 -0700 Subject: [PATCH 14/50] Test with script --- .github/workflows/poetry-install.yaml | 4 +--- scripts/poetry-install.sh | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) mode change 100755 => 100644 scripts/poetry-install.sh diff --git a/.github/workflows/poetry-install.yaml b/.github/workflows/poetry-install.yaml index b08b862..0587db9 100644 --- a/.github/workflows/poetry-install.yaml +++ b/.github/workflows/poetry-install.yaml @@ -10,9 +10,7 @@ jobs: with: python-version: "3.12" - name: Install Poetry - run: | - python3 -m venv ${{vars.POETRY_HOME}} - ${{vars.POETRY_HOME}}/bin/pip install poetry==1.2.0 + run: ./scripts/poetry-install.sh - name: Install dependencies run: ${{vars.POETRY}} install # - name: Build Artifact diff --git a/scripts/poetry-install.sh b/scripts/poetry-install.sh old mode 100755 new mode 100644 index 26b38c9..5493431 --- a/scripts/poetry-install.sh +++ b/scripts/poetry-install.sh @@ -1,3 +1,3 @@ #!/bin/bash -python3 -m venv $POETRY_HOME -$POETRY_HOME/bin/pip install poetry==1.2.0 \ No newline at end of file +python3 -m venv ${{vars.POETRY_HOME}} +${{vars.POETRY_HOME}}/bin/pip install poetry==1.2.0 \ No newline at end of file From 4ab739203aecc05f396b01ed7486fa39297fa762 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Tue, 11 Jun 2024 12:52:10 -0700 Subject: [PATCH 15/50] Give permissions --- scripts/poetry-install.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/poetry-install.sh diff --git a/scripts/poetry-install.sh b/scripts/poetry-install.sh old mode 100644 new mode 100755 From 094c01a34bc8f8fe91cbccda657456edd323e0f7 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Tue, 11 Jun 2024 12:58:00 -0700 Subject: [PATCH 16/50] Changes to script --- .github/workflows/poetry-install.yaml | 7 +++++-- scripts/poetry-install.sh | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/poetry-install.yaml b/.github/workflows/poetry-install.yaml index 0587db9..7ec373b 100644 --- a/.github/workflows/poetry-install.yaml +++ b/.github/workflows/poetry-install.yaml @@ -1,5 +1,8 @@ name: poetry on: [push, pull_request, workflow_dispatch] +env: + POETRY_HOME: ${{vars.POETRY_HOME}} + POETRY: ${{vars.POETRY}} jobs: poetry: runs-on: ubuntu-latest @@ -12,12 +15,12 @@ jobs: - name: Install Poetry run: ./scripts/poetry-install.sh - name: Install dependencies - run: ${{vars.POETRY}} install + run: $POETRY install # - name: Build Artifact # run: $POETRY build - name: Lint with ruff uses: chartboost/ruff-action@v1 continue-on-error: true - name: Python tests - run: ${{vars.POETRY}} run pytest + run: $POETRY run pytest continue-on-error: true diff --git a/scripts/poetry-install.sh b/scripts/poetry-install.sh index 5493431..26b38c9 100755 --- a/scripts/poetry-install.sh +++ b/scripts/poetry-install.sh @@ -1,3 +1,3 @@ #!/bin/bash -python3 -m venv ${{vars.POETRY_HOME}} -${{vars.POETRY_HOME}}/bin/pip install poetry==1.2.0 \ No newline at end of file +python3 -m venv $POETRY_HOME +$POETRY_HOME/bin/pip install poetry==1.2.0 \ No newline at end of file From b5948a954f6ca4f3f065378389d93c4e02888a0e Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Tue, 11 Jun 2024 15:25:26 -0700 Subject: [PATCH 17/50] Add docs --- .github/workflows/poetry-install.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/poetry-install.yaml b/.github/workflows/poetry-install.yaml index 7ec373b..5dc1f50 100644 --- a/.github/workflows/poetry-install.yaml +++ b/.github/workflows/poetry-install.yaml @@ -24,3 +24,6 @@ jobs: - name: Python tests run: $POETRY run pytest continue-on-error: true + - name: Check docs + run: $POETRY run make html + continue-on-error: true From d33d6a4fe1a30ad40eb0d22fcfcaf76e905d4d37 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Tue, 11 Jun 2024 15:45:42 -0700 Subject: [PATCH 18/50] Checking if poetry not installed and pytest --- .github/workflows/tests.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/tests.yaml diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..a1d9110 --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,21 @@ +name: poetry +on: [pull_request, workflow_dispatch] +env: + POETRY_HOME: ${{vars.POETRY_HOME}} + POETRY: ${{vars.POETRY}} +jobs: + poetry: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Install Poetry + run: ./scripts/poetry-install.sh + # - name: Install dependencies + # run: $POETRY install + - name: Python tests + run: $POETRY run pytest + continue-on-error: true \ No newline at end of file From 2376c537669552bd5971dc097f79bfa9929b8ae7 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Tue, 11 Jun 2024 15:45:53 -0700 Subject: [PATCH 19/50] Add this change --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index a1d9110..fcbc4c3 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -1,5 +1,5 @@ name: poetry -on: [pull_request, workflow_dispatch] +on: [pull_request, push, workflow_dispatch] env: POETRY_HOME: ${{vars.POETRY_HOME}} POETRY: ${{vars.POETRY}} From 6d72f4910897b302790cab731a1c48bbe25bdadc Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Tue, 11 Jun 2024 16:00:34 -0700 Subject: [PATCH 20/50] Add files for test, ruff, docs --- .github/workflows/docs.yaml | 20 ++++++++++++++ .github/workflows/poetry-install.yaml | 32 +++++++++-------------- .github/workflows/{ruff.yml => ruff.yaml} | 2 +- .github/workflows/tests.yaml | 14 +++++++--- scripts/poetry-install.sh | 3 ++- 5 files changed, 45 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/docs.yaml rename .github/workflows/{ruff.yml => ruff.yaml} (85%) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml new file mode 100644 index 0000000..8a19965 --- /dev/null +++ b/.github/workflows/docs.yaml @@ -0,0 +1,20 @@ +name: poetry +on: [push, pull_request] +env: + POETRY_HOME: ${{vars.POETRY_HOME}} + POETRY: ${{vars.POETRY}} +jobs: + poetry: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Install Poetry and dependencies + run: ./scripts/poetry-install.sh + - name: Check docs + working-directory: ./docs + run: $POETRY run make html + continue-on-error: true \ No newline at end of file diff --git a/.github/workflows/poetry-install.yaml b/.github/workflows/poetry-install.yaml index 5dc1f50..7f73aa5 100644 --- a/.github/workflows/poetry-install.yaml +++ b/.github/workflows/poetry-install.yaml @@ -1,29 +1,21 @@ name: poetry -on: [push, pull_request, workflow_dispatch] +on: [pull_request, push, workflow_dispatch] env: POETRY_HOME: ${{vars.POETRY_HOME}} POETRY: ${{vars.POETRY}} jobs: poetry: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install python - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - name: Install Poetry - run: ./scripts/poetry-install.sh - - name: Install dependencies - run: $POETRY install + # steps: + # - uses: actions/checkout@v4 + # - name: Install python + # # uses: actions/setup-python@v5 + # # with: + # # python-version: "3.12" + # # - name: Install Poetry and dependencies + # # run: ./scripts/poetry-install.sh # - name: Build Artifact # run: $POETRY build - - name: Lint with ruff - uses: chartboost/ruff-action@v1 - continue-on-error: true - - name: Python tests - run: $POETRY run pytest - continue-on-error: true - - name: Check docs - run: $POETRY run make html - continue-on-error: true + # - name: Lint with ruff + # uses: chartboost/ruff-action@v1 + # continue-on-error: true diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yaml similarity index 85% rename from .github/workflows/ruff.yml rename to .github/workflows/ruff.yaml index 8e10796..e4f4d35 100644 --- a/.github/workflows/ruff.yml +++ b/.github/workflows/ruff.yaml @@ -1,5 +1,5 @@ name: Ruff -on: [pull_request] +on: [workflow_dispatch] jobs: ruff: runs-on: ubuntu-latest diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index fcbc4c3..2fd50b9 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -1,8 +1,16 @@ name: poetry -on: [pull_request, push, workflow_dispatch] +on: [pull_request, push] env: POETRY_HOME: ${{vars.POETRY_HOME}} POETRY: ${{vars.POETRY}} + HPCC_USERNAME: ${{ secrets.HPCC_USERNAME }} + HPCC_PASSWORD: ${{ secrets.HPCC_PASSWORD }} + DUMMY_USERNAME: ${{ secrets.DUMMY_USERNAME }} + DUMMY_PASSWORD: ${{ secrets.DUMMY_PASSWORD }} + HPCC_HOST: ${{ secrets.HPCC_HOST }} + HPCC_PORT: ${{ secrets.HPCC_PORT }} + DUMMY_HOST: ${{ secrets.DUMMY_HOST }} + DUMMY_PORT: ${{ secrets.DUMMY_PORT }} jobs: poetry: runs-on: ubuntu-latest @@ -12,10 +20,8 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.12" - - name: Install Poetry + - name: Install Poetry and dependencies run: ./scripts/poetry-install.sh - # - name: Install dependencies - # run: $POETRY install - name: Python tests run: $POETRY run pytest continue-on-error: true \ No newline at end of file diff --git a/scripts/poetry-install.sh b/scripts/poetry-install.sh index 26b38c9..8c45168 100755 --- a/scripts/poetry-install.sh +++ b/scripts/poetry-install.sh @@ -1,3 +1,4 @@ #!/bin/bash python3 -m venv $POETRY_HOME -$POETRY_HOME/bin/pip install poetry==1.2.0 \ No newline at end of file +$POETRY_HOME/bin/pip install poetry==1.2.0 +$POETRY install \ No newline at end of file From f0d0adbb2cabdc08f18409b9267f52a5ba7950fe Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Tue, 11 Jun 2024 16:01:54 -0700 Subject: [PATCH 21/50] Fix file --- .github/workflows/poetry-install.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/poetry-install.yaml b/.github/workflows/poetry-install.yaml index 7f73aa5..156c155 100644 --- a/.github/workflows/poetry-install.yaml +++ b/.github/workflows/poetry-install.yaml @@ -6,12 +6,12 @@ env: jobs: poetry: runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v4 - # - name: Install python - # # uses: actions/setup-python@v5 - # # with: - # # python-version: "3.12" + steps: + - uses: actions/checkout@v4 + - name: Install python + uses: actions/setup-python@v5 + with: + python-version: "3.12" # # - name: Install Poetry and dependencies # # run: ./scripts/poetry-install.sh # - name: Build Artifact From f6e8fdc9d447d428dda39279460e32fc26714984 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Tue, 11 Jun 2024 16:09:13 -0700 Subject: [PATCH 22/50] Make changes for on condition --- .github/workflows/docs.yaml | 7 ++++-- .github/workflows/only-run-tests.yaml | 34 --------------------------- .github/workflows/poetry-install.yaml | 7 ++++-- .github/workflows/ruff.yaml | 5 +++- .github/workflows/tests.yaml | 7 ++++-- 5 files changed, 19 insertions(+), 41 deletions(-) delete mode 100644 .github/workflows/only-run-tests.yaml diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 8a19965..cd4e884 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -1,5 +1,8 @@ -name: poetry -on: [push, pull_request] +name: Make docs +on: + pull_request: + branches: + - main, dev env: POETRY_HOME: ${{vars.POETRY_HOME}} POETRY: ${{vars.POETRY}} diff --git a/.github/workflows/only-run-tests.yaml b/.github/workflows/only-run-tests.yaml deleted file mode 100644 index f27f29d..0000000 --- a/.github/workflows/only-run-tests.yaml +++ /dev/null @@ -1,34 +0,0 @@ -name: only-run-tests-workflow -on: - push: - branches: - - dev - -jobs: - run-tests: - runs-on: [ubuntu] - strategy: - matrix: - python-version: ["3.8", "3.9", "3.10"] - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - name: Run tests - env: - HPCC_USERNAME: ${{ secrets.HPCC_USERNAME }} - HPCC_PASSWORD: ${{ secrets.HPCC_PASSWORD }} - DUMMY_USERNAME: ${{ secrets.DUMMY_USERNAME }} - DUMMY_PASSWORD: ${{ secrets.DUMMY_PASSWORD }} - HPCC_HOST: ${{ secrets.HPCC_HOST }} - HPCC_PORT: ${{ secrets.HPCC_PORT }} - DUMMY_HOST: ${{ secrets.DUMMY_HOST }} - DUMMY_PORT: ${{ secrets.DUMMY_PORT }} - run: | - python -m pytest tests diff --git a/.github/workflows/poetry-install.yaml b/.github/workflows/poetry-install.yaml index 156c155..101ff57 100644 --- a/.github/workflows/poetry-install.yaml +++ b/.github/workflows/poetry-install.yaml @@ -1,5 +1,8 @@ -name: poetry -on: [pull_request, push, workflow_dispatch] +name: poetry-install +on: + pull_request: + branches: + - features/gh_actions env: POETRY_HOME: ${{vars.POETRY_HOME}} POETRY: ${{vars.POETRY}} diff --git a/.github/workflows/ruff.yaml b/.github/workflows/ruff.yaml index e4f4d35..b627ed8 100644 --- a/.github/workflows/ruff.yaml +++ b/.github/workflows/ruff.yaml @@ -1,5 +1,8 @@ name: Ruff -on: [workflow_dispatch] +on: + pull_request: + branches: + - main, dev jobs: ruff: runs-on: ubuntu-latest diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 2fd50b9..0a9c660 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -1,5 +1,8 @@ -name: poetry -on: [pull_request, push] +name: Run tests +on: + pull_request: + branches: + - main, dev env: POETRY_HOME: ${{vars.POETRY_HOME}} POETRY: ${{vars.POETRY}} From 6b5f6be6961fdf5e281414cbbde80cb074738021 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Tue, 11 Jun 2024 16:12:39 -0700 Subject: [PATCH 23/50] Make pull_request to pull_request_target --- .github/workflows/docs.yaml | 2 +- .github/workflows/poetry-install.yaml | 2 +- .github/workflows/ruff.yaml | 2 +- .github/workflows/tests.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index cd4e884..2d936b1 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -1,6 +1,6 @@ name: Make docs on: - pull_request: + pull_request_target: branches: - main, dev env: diff --git a/.github/workflows/poetry-install.yaml b/.github/workflows/poetry-install.yaml index 101ff57..ec812f9 100644 --- a/.github/workflows/poetry-install.yaml +++ b/.github/workflows/poetry-install.yaml @@ -1,6 +1,6 @@ name: poetry-install on: - pull_request: + pull_request_target: branches: - features/gh_actions env: diff --git a/.github/workflows/ruff.yaml b/.github/workflows/ruff.yaml index b627ed8..2eca4a9 100644 --- a/.github/workflows/ruff.yaml +++ b/.github/workflows/ruff.yaml @@ -1,6 +1,6 @@ name: Ruff on: - pull_request: + pull_request_target: branches: - main, dev jobs: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 0a9c660..ef6948c 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -1,6 +1,6 @@ name: Run tests on: - pull_request: + pull_request_target: branches: - main, dev env: From 597c17d9cc7497a04cb7058a633a4b7ab9fef7f4 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Tue, 11 Jun 2024 16:14:52 -0700 Subject: [PATCH 24/50] on condition change --- .github/workflows/docs.yaml | 5 +---- .github/workflows/poetry-install.yaml | 5 +---- .github/workflows/ruff.yaml | 5 +---- .github/workflows/tests.yaml | 5 +---- 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 2d936b1..69c250f 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -1,8 +1,5 @@ name: Make docs -on: - pull_request_target: - branches: - - main, dev +on: [pull_request] env: POETRY_HOME: ${{vars.POETRY_HOME}} POETRY: ${{vars.POETRY}} diff --git a/.github/workflows/poetry-install.yaml b/.github/workflows/poetry-install.yaml index ec812f9..4386466 100644 --- a/.github/workflows/poetry-install.yaml +++ b/.github/workflows/poetry-install.yaml @@ -1,8 +1,5 @@ name: poetry-install -on: - pull_request_target: - branches: - - features/gh_actions +on: [pull_request] env: POETRY_HOME: ${{vars.POETRY_HOME}} POETRY: ${{vars.POETRY}} diff --git a/.github/workflows/ruff.yaml b/.github/workflows/ruff.yaml index 2eca4a9..8e10796 100644 --- a/.github/workflows/ruff.yaml +++ b/.github/workflows/ruff.yaml @@ -1,8 +1,5 @@ name: Ruff -on: - pull_request_target: - branches: - - main, dev +on: [pull_request] jobs: ruff: runs-on: ubuntu-latest diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ef6948c..2082289 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -1,8 +1,5 @@ name: Run tests -on: - pull_request_target: - branches: - - main, dev +on: [pull_request] env: POETRY_HOME: ${{vars.POETRY_HOME}} POETRY: ${{vars.POETRY}} From 93422f3b6eca49aeb70a0234bed25f19bb829de8 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Wed, 12 Jun 2024 08:54:01 -0700 Subject: [PATCH 25/50] Make change to push condition --- .github/workflows/docs.yaml | 8 +++++++- .github/workflows/poetry-install.yaml | 8 +++++++- .github/workflows/ruff.yaml | 8 +++++++- .github/workflows/tests.yaml | 8 +++++++- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 69c250f..e57a1fb 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -1,5 +1,11 @@ name: Make docs -on: [pull_request] +on: + push: + branches: + main + pull_request: + branches: + main env: POETRY_HOME: ${{vars.POETRY_HOME}} POETRY: ${{vars.POETRY}} diff --git a/.github/workflows/poetry-install.yaml b/.github/workflows/poetry-install.yaml index 4386466..d5ed807 100644 --- a/.github/workflows/poetry-install.yaml +++ b/.github/workflows/poetry-install.yaml @@ -1,5 +1,11 @@ name: poetry-install -on: [pull_request] +on: + push: + branches: + main + pull_request: + branches: + main env: POETRY_HOME: ${{vars.POETRY_HOME}} POETRY: ${{vars.POETRY}} diff --git a/.github/workflows/ruff.yaml b/.github/workflows/ruff.yaml index 8e10796..a56e0d5 100644 --- a/.github/workflows/ruff.yaml +++ b/.github/workflows/ruff.yaml @@ -1,5 +1,11 @@ name: Ruff -on: [pull_request] +on: + push: + branches: + main + pull_request: + branches: + main jobs: ruff: runs-on: ubuntu-latest diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 2082289..baa6bdb 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -1,5 +1,11 @@ name: Run tests -on: [pull_request] +on: + push: + branches: + main + pull_request: + branches: + main env: POETRY_HOME: ${{vars.POETRY_HOME}} POETRY: ${{vars.POETRY}} From bae469118c850b927dee8086996978b358780d61 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Wed, 12 Jun 2024 08:57:36 -0700 Subject: [PATCH 26/50] Remove poetry installation task --- .github/workflows/poetry-install.yaml | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 .github/workflows/poetry-install.yaml diff --git a/.github/workflows/poetry-install.yaml b/.github/workflows/poetry-install.yaml deleted file mode 100644 index d5ed807..0000000 --- a/.github/workflows/poetry-install.yaml +++ /dev/null @@ -1,27 +0,0 @@ -name: poetry-install -on: - push: - branches: - main - pull_request: - branches: - main -env: - POETRY_HOME: ${{vars.POETRY_HOME}} - POETRY: ${{vars.POETRY}} -jobs: - poetry: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install python - uses: actions/setup-python@v5 - with: - python-version: "3.12" - # # - name: Install Poetry and dependencies - # # run: ./scripts/poetry-install.sh - # - name: Build Artifact - # run: $POETRY build - # - name: Lint with ruff - # uses: chartboost/ruff-action@v1 - # continue-on-error: true From 4167049b8ecb391d377d14777b8737a58def6911 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Wed, 12 Jun 2024 10:59:51 -0700 Subject: [PATCH 27/50] upload artifact --- .github/workflows/upload-artifact.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/upload-artifact.yaml diff --git a/.github/workflows/upload-artifact.yaml b/.github/workflows/upload-artifact.yaml new file mode 100644 index 0000000..b785064 --- /dev/null +++ b/.github/workflows/upload-artifact.yaml @@ -0,0 +1,21 @@ +name: Upload Artifact example +on: + push: + branches: + main + pull_request: + branches: + main +jobs: + example-job: + name: Save output + runs-on: ubuntu-latest + steps: + - shell: bash + run: | + expr 1 + 1 > output.log + - name: Upload output file + uses: actions/upload-artifact@v4 + with: + name: output-log-file + path: output.log From bc18bd30e044b082b743765defd7e7be4b3af002 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Wed, 12 Jun 2024 11:32:57 -0700 Subject: [PATCH 28/50] Add --no-root for faster installation --- scripts/poetry-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/poetry-install.sh b/scripts/poetry-install.sh index 8c45168..32576fd 100755 --- a/scripts/poetry-install.sh +++ b/scripts/poetry-install.sh @@ -1,4 +1,4 @@ #!/bin/bash python3 -m venv $POETRY_HOME $POETRY_HOME/bin/pip install poetry==1.2.0 -$POETRY install \ No newline at end of file +$POETRY install --no-root \ No newline at end of file From 239a159452492b0471b4c7438d6d6754928117b6 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Wed, 12 Jun 2024 11:37:30 -0700 Subject: [PATCH 29/50] Remove root flag --- scripts/poetry-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/poetry-install.sh b/scripts/poetry-install.sh index 32576fd..8c45168 100755 --- a/scripts/poetry-install.sh +++ b/scripts/poetry-install.sh @@ -1,4 +1,4 @@ #!/bin/bash python3 -m venv $POETRY_HOME $POETRY_HOME/bin/pip install poetry==1.2.0 -$POETRY install --no-root \ No newline at end of file +$POETRY install \ No newline at end of file From 8c284f99944549a4e1dc9f715390954ee6999955 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Wed, 12 Jun 2024 11:46:21 -0700 Subject: [PATCH 30/50] Add docs with exclude condition --- .github/workflows/docs.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index e57a1fb..13b22ad 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -22,5 +22,4 @@ jobs: run: ./scripts/poetry-install.sh - name: Check docs working-directory: ./docs - run: $POETRY run make html - continue-on-error: true \ No newline at end of file + run: $POETRY run make html \ No newline at end of file From 8241781d0b53fdb55e6179a473364b490220029c Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Wed, 12 Jun 2024 11:58:33 -0700 Subject: [PATCH 31/50] Use coverage extension for posting coverage --- .github/workflows/pytest-coverage.yaml | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/pytest-coverage.yaml diff --git a/.github/workflows/pytest-coverage.yaml b/.github/workflows/pytest-coverage.yaml new file mode 100644 index 0000000..a59c8c7 --- /dev/null +++ b/.github/workflows/pytest-coverage.yaml @@ -0,0 +1,27 @@ +name: 'coverage' +on: + pull_request: + branches: + - master + - main +jobs: + coverage: + name: PyTest coverage + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Install Poetry and dependencies + run: ./scripts/poetry-install.sh + - name: Run coverage + run: | + coverage run -m pytest + coverage xml + - name: Get Cover + uses: orgoro/coverage@v3.1 + with: + coverageFile: ./coverage.xml + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From b71a2580535034fc2fb67e2046d3586ad4f93b95 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Wed, 12 Jun 2024 11:59:41 -0700 Subject: [PATCH 32/50] Fix indentation --- .github/workflows/pytest-coverage.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest-coverage.yaml b/.github/workflows/pytest-coverage.yaml index a59c8c7..213d458 100644 --- a/.github/workflows/pytest-coverage.yaml +++ b/.github/workflows/pytest-coverage.yaml @@ -3,7 +3,7 @@ on: pull_request: branches: - master - - main + - main jobs: coverage: name: PyTest coverage From 16b30d758105f976891e016b6ef02ea714c26d20 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Wed, 12 Jun 2024 12:10:12 -0700 Subject: [PATCH 33/50] Add coverage dependency --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 6c3505d..8a0d9cb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,6 +20,8 @@ elementpath = "^3.0.2" # XPath selectors for XML Data structures pytest = "^7.1.3" pytest-mock = "^3.0.2" +[tool.poetry.group.coverage.dependencies] +coverage = "^7.5.3" From d8281f36f8ff2c74937535b386c02999d77839fe Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Wed, 12 Jun 2024 12:17:49 -0700 Subject: [PATCH 34/50] Add on workflow dispatch --- .github/workflows/pytest-coverage.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pytest-coverage.yaml b/.github/workflows/pytest-coverage.yaml index 213d458..673a481 100644 --- a/.github/workflows/pytest-coverage.yaml +++ b/.github/workflows/pytest-coverage.yaml @@ -4,6 +4,7 @@ on: branches: - master - main + workflow_dispatch: jobs: coverage: name: PyTest coverage From 16b20412f0e41fcf38c3bfd1863cf151d3571ef1 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Wed, 12 Jun 2024 12:18:51 -0700 Subject: [PATCH 35/50] Remove spaces --- .github/workflows/pytest-coverage.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest-coverage.yaml b/.github/workflows/pytest-coverage.yaml index 673a481..d4826b0 100644 --- a/.github/workflows/pytest-coverage.yaml +++ b/.github/workflows/pytest-coverage.yaml @@ -16,7 +16,7 @@ jobs: with: python-version: "3.12" - name: Install Poetry and dependencies - run: ./scripts/poetry-install.sh + run: ./scripts/poetry-install.sh - name: Run coverage run: | coverage run -m pytest From 63190139ad97b9fd49cf3b6034d4cfa23ba99188 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Wed, 12 Jun 2024 12:21:08 -0700 Subject: [PATCH 36/50] Check again --- .github/workflows/pytest-coverage.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pytest-coverage.yaml b/.github/workflows/pytest-coverage.yaml index d4826b0..90f6169 100644 --- a/.github/workflows/pytest-coverage.yaml +++ b/.github/workflows/pytest-coverage.yaml @@ -1,9 +1,11 @@ -name: 'coverage' -on: +name: Make docs +on: + push: + branches: + main pull_request: branches: - - master - - main + main workflow_dispatch: jobs: coverage: From 45804f11ad4c3db448b3978c77325efb7dbf548a Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Wed, 12 Jun 2024 12:22:22 -0700 Subject: [PATCH 37/50] Comment things out --- .github/workflows/pytest-coverage.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pytest-coverage.yaml b/.github/workflows/pytest-coverage.yaml index 90f6169..2818ce7 100644 --- a/.github/workflows/pytest-coverage.yaml +++ b/.github/workflows/pytest-coverage.yaml @@ -19,12 +19,12 @@ jobs: python-version: "3.12" - name: Install Poetry and dependencies run: ./scripts/poetry-install.sh - - name: Run coverage - run: | - coverage run -m pytest - coverage xml - - name: Get Cover - uses: orgoro/coverage@v3.1 - with: - coverageFile: ./coverage.xml - token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + # - name: Run coverage + # run: | + # coverage run -m pytest + # coverage xml + # - name: Get Cover + # uses: orgoro/coverage@v3.1 + # with: + # coverageFile: ./coverage.xml + # token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From bd2effcd22e316fb04308f82179041cfc5be84ec Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Wed, 12 Jun 2024 12:25:23 -0700 Subject: [PATCH 38/50] Add env properties --- .github/workflows/pytest-coverage.yaml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pytest-coverage.yaml b/.github/workflows/pytest-coverage.yaml index 2818ce7..a7cfc9e 100644 --- a/.github/workflows/pytest-coverage.yaml +++ b/.github/workflows/pytest-coverage.yaml @@ -7,6 +7,9 @@ on: branches: main workflow_dispatch: +env: + POETRY_HOME: ${{vars.POETRY_HOME}} + POETRY: ${{vars.POETRY}} jobs: coverage: name: PyTest coverage @@ -19,12 +22,12 @@ jobs: python-version: "3.12" - name: Install Poetry and dependencies run: ./scripts/poetry-install.sh - # - name: Run coverage - # run: | - # coverage run -m pytest - # coverage xml - # - name: Get Cover - # uses: orgoro/coverage@v3.1 - # with: - # coverageFile: ./coverage.xml - # token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + - name: Run coverage + run: | + coverage run -m pytest + coverage xml + - name: Get Cover + uses: orgoro/coverage@v3.1 + with: + coverageFile: ./coverage.xml + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From b2365818cdb800a6c2e9bfa09326bf11dd2841b9 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Wed, 12 Jun 2024 12:26:18 -0700 Subject: [PATCH 39/50] Change name of workflow --- .github/workflows/pytest-coverage.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest-coverage.yaml b/.github/workflows/pytest-coverage.yaml index a7cfc9e..e902790 100644 --- a/.github/workflows/pytest-coverage.yaml +++ b/.github/workflows/pytest-coverage.yaml @@ -1,4 +1,4 @@ -name: Make docs +name: Test Coverage on: push: branches: From fc0058d78ed5c5ddc93aac2292872f4a6d083f01 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Wed, 12 Jun 2024 12:35:47 -0700 Subject: [PATCH 40/50] change coverage to poetry commands --- .github/workflows/pytest-coverage.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest-coverage.yaml b/.github/workflows/pytest-coverage.yaml index e902790..7db4b5f 100644 --- a/.github/workflows/pytest-coverage.yaml +++ b/.github/workflows/pytest-coverage.yaml @@ -24,8 +24,8 @@ jobs: run: ./scripts/poetry-install.sh - name: Run coverage run: | - coverage run -m pytest - coverage xml + $POETRY run coverage run -m pytest + $POETRY run coverage xml - name: Get Cover uses: orgoro/coverage@v3.1 with: From c87673e21ff582ba4fbcba12204fc04fe4fb5862 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Wed, 12 Jun 2024 12:47:29 -0700 Subject: [PATCH 41/50] continue on error even if tests fail --- .github/workflows/pytest-coverage.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest-coverage.yaml b/.github/workflows/pytest-coverage.yaml index 7db4b5f..4f96695 100644 --- a/.github/workflows/pytest-coverage.yaml +++ b/.github/workflows/pytest-coverage.yaml @@ -22,10 +22,12 @@ jobs: python-version: "3.12" - name: Install Poetry and dependencies run: ./scripts/poetry-install.sh - - name: Run coverage + - name: Run Tests run: | $POETRY run coverage run -m pytest - $POETRY run coverage xml + continue-on-error: true + - name: Run Coverage + run: $POETRY run coverage xml - name: Get Cover uses: orgoro/coverage@v3.1 with: From 67eb1ddf0ce638a8d41c1087ad9b39ce83d03621 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Wed, 12 Jun 2024 12:58:09 -0700 Subject: [PATCH 42/50] Remove artifact example --- .github/workflows/upload-artifact.yaml | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 .github/workflows/upload-artifact.yaml diff --git a/.github/workflows/upload-artifact.yaml b/.github/workflows/upload-artifact.yaml deleted file mode 100644 index b785064..0000000 --- a/.github/workflows/upload-artifact.yaml +++ /dev/null @@ -1,21 +0,0 @@ -name: Upload Artifact example -on: - push: - branches: - main - pull_request: - branches: - main -jobs: - example-job: - name: Save output - runs-on: ubuntu-latest - steps: - - shell: bash - run: | - expr 1 + 1 > output.log - - name: Upload output file - uses: actions/upload-artifact@v4 - with: - name: output-log-file - path: output.log From 12627a6f997abc2e384b398101e2bfcc567def64 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Wed, 12 Jun 2024 14:29:25 -0700 Subject: [PATCH 43/50] configure toml file for coverage, add contribution info for coverage, fix test file --- CONTRIBUTING.md | 8 ++++++++ pyproject.toml | 5 ++++- tests/test_hpcc_api.py | 11 ++++++----- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8da7708..f1b75b2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -41,5 +41,13 @@ ruff format # For formatting your code. ``` +## PR Guidelines +For test coverage, please make sure to have more than 85% code coverage for both the individual and overall. +To check code coverage, run the following commands +``` bash +poetry run coverage run +poetry run coverage report +``` + diff --git a/pyproject.toml b/pyproject.toml index 8a0d9cb..cb83dd0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,10 @@ pytest-mock = "^3.0.2" [tool.poetry.group.coverage.dependencies] coverage = "^7.5.3" - +#For Python Coverage +[tool.coverage.run] +command_line = "-m pytest" +source = ["."] [build-system] diff --git a/tests/test_hpcc_api.py b/tests/test_hpcc_api.py index 599c08c..fdf9cd1 100644 --- a/tests/test_hpcc_api.py +++ b/tests/test_hpcc_api.py @@ -1,12 +1,13 @@ # Unit tests to test the authentication module -import config import os # used by test_UploadFile import unittest - from datetime import datetime # used by test_UploadFile -from pyhpcc.auth import auth -from pyhpcc.models import hpcc + +import config + +from pyhpcc.auth import Auth from pyhpcc.errors import HPCCException +from pyhpcc.models import hpcc class TestHPCCAPI(unittest.TestCase): @@ -19,7 +20,7 @@ class TestHPCCAPI(unittest.TestCase): DUMMY_HPCC_HOST = config.DUMMY_HPCC_HOST DUMMY_HPCC_PORT = config.DUMMY_HPCC_PORT - AUTH_OBJ = auth(HPCC_HOST, HPCC_PORT, HPCC_USERNAME, HPCC_PASSWORD, True, "https") + AUTH_OBJ = Auth(HPCC_HOST, HPCC_PORT, HPCC_USERNAME, HPCC_PASSWORD, True, "https") HPCC_OBJ = hpcc(AUTH_OBJ) # Used by test_AddtoSuperfileRequest, test_getSubFileInfoall From dd7269a47b85363073b3c240f8c021dbab0da483 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Wed, 12 Jun 2024 14:38:26 -0700 Subject: [PATCH 44/50] Cache dependencies --- .github/workflows/pytest-coverage.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pytest-coverage.yaml b/.github/workflows/pytest-coverage.yaml index 4f96695..91209c6 100644 --- a/.github/workflows/pytest-coverage.yaml +++ b/.github/workflows/pytest-coverage.yaml @@ -20,6 +20,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.12" + cache: 'poetry' - name: Install Poetry and dependencies run: ./scripts/poetry-install.sh - name: Run Tests From 0096a1e989822391cdb3dffbc62f5cbae0a9ecb8 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Wed, 12 Jun 2024 14:39:55 -0700 Subject: [PATCH 45/50] Revert "Cache dependencies" This reverts commit dd7269a47b85363073b3c240f8c021dbab0da483. --- .github/workflows/pytest-coverage.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pytest-coverage.yaml b/.github/workflows/pytest-coverage.yaml index 91209c6..4f96695 100644 --- a/.github/workflows/pytest-coverage.yaml +++ b/.github/workflows/pytest-coverage.yaml @@ -20,7 +20,6 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.12" - cache: 'poetry' - name: Install Poetry and dependencies run: ./scripts/poetry-install.sh - name: Run Tests From e4a64d9eb071f265ae269bb081f3a184e9ccaffb Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Wed, 12 Jun 2024 14:43:20 -0700 Subject: [PATCH 46/50] Remove continue on error for gh workflow test --- .github/workflows/tests.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index baa6bdb..796ad59 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -29,5 +29,4 @@ jobs: - name: Install Poetry and dependencies run: ./scripts/poetry-install.sh - name: Python tests - run: $POETRY run pytest - continue-on-error: true \ No newline at end of file + run: $POETRY run pytest \ No newline at end of file From ee4a2905c3db8b66eedf48bd4f99e1a604b95013 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Wed, 12 Jun 2024 14:52:33 -0700 Subject: [PATCH 47/50] Make build and save as artifact --- .github/workflows/build.yaml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..ef9c1ff --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,22 @@ +name: Make build +on: workflow_dispatch +env: + POETRY_HOME: ${{vars.POETRY_HOME}} + POETRY: ${{vars.POETRY}} +jobs: + poetry: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Install Poetry and dependencies + run: ./scripts/poetry-install.sh + - name: Make build + run: $POETRY build + - uses: actions/upload-artifact@v4 + with: + name: dist + path: ./dist \ No newline at end of file From cdc35acaf197908b30dce9885c91c5a11654c9e7 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Wed, 12 Jun 2024 14:55:23 -0700 Subject: [PATCH 48/50] Test build --- .github/workflows/build.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ef9c1ff..549795d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,5 +1,11 @@ name: Make build -on: workflow_dispatch +on: + push: + branches: + main + pull_request: + branches: + main env: POETRY_HOME: ${{vars.POETRY_HOME}} POETRY: ${{vars.POETRY}} From 1a48f06bf1feed4446b3615a3c0ad181e5b61065 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Wed, 12 Jun 2024 15:24:31 -0700 Subject: [PATCH 49/50] Add changes for PR guidelines in contribution.md --- CONTRIBUTING.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f1b75b2..87561a2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -49,5 +49,15 @@ poetry run coverage run poetry run coverage report ``` +## Submitting an PR +[Create a PR](https://help.github.com/articles/creating-a-pull-request/) with the following configuration: + +The base branch is the main repo's main branch. +- PR name: copy-and-paste the relevant issue name and include the issue number in front in square brackets, e.g. `[#1020] Make bash_runcommand in WorkUnitSubmit class configurable ` +- PR description: mention the issue number in this format: Fixes #1020. Doing so will automatically close the related issue once the PR is merged. +- Please Ensure that "Allow edits from maintainers" is ticked. +- Please describe the changes you have made in your branch and how they resolve the issue. + + From 3b13f7a962d714a2b2e92f55208102b463591cb1 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Wed, 12 Jun 2024 15:42:39 -0700 Subject: [PATCH 50/50] Add pull request template --- .github/pull_request_template.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..946134c --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,18 @@ + + + + + + + +Fixes # + +### Type of change: + +### Description + + +### Checklist +- Did I make sure I wrote the tests if I have implemented new functionality? +- Did I make sure the test coverage meets the guidelines specified in CONTRIBUTING.md? +- Did I lint and format the code? \ No newline at end of file