From ecd630c7dc7186d31fee23f9ac5e0ff40b1f3b38 Mon Sep 17 00:00:00 2001 From: Javid Ahmed Date: Sat, 6 Jun 2026 21:01:44 +0100 Subject: [PATCH 1/3] Refactor CI and build workflows to streamline setup steps and enhance frontend checks --- .github/workflows/build.yml | 5 +-- .github/workflows/ci.yml | 64 ++++++++++++++++++++++++------------- .github/workflows/docs.yml | 4 +-- 3 files changed, 47 insertions(+), 26 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9f4f45b..ff1f803 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,14 +5,14 @@ on: branches: - main pull_request: - branches: - - main jobs: build-wheel: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 + - uses: javidahmed64592/actions-template-python/actions/setup/setup-uv-python@main + - uses: javidahmed64592/actions-template-python/actions/setup/install-python-core@main - uses: javidahmed64592/actions-template-python/actions/build/build-wheel@main verify-structure: @@ -20,6 +20,7 @@ jobs: needs: build-wheel steps: - uses: actions/checkout@v6 + - uses: javidahmed64592/actions-template-python/actions/setup/setup-uv-python@main - uses: javidahmed64592/actions-template-python/actions/build/verify-structure@main with: frontend-dir-exists: false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 537d812..1fa3715 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,54 +5,74 @@ on: branches: - main pull_request: - branches: - - main jobs: - validate-pyproject: + python-validate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - - uses: javidahmed64592/actions-template-python/actions/ci/validate-pyproject@main + - uses: javidahmed64592/actions-template-python/actions/setup/setup-uv-python@main + - uses: javidahmed64592/actions-template-python/actions/setup/install-python-dev@main + - uses: javidahmed64592/actions-template-python/actions/setup/check-frontend-exists@main + id: check-frontend-exists - ruff: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: javidahmed64592/actions-template-python/actions/ci/ruff@main + - uses: javidahmed64592/actions-template-python/actions/ci/python-validate@main + with: + frontend-dir-exists: ${{ steps.check-frontend-exists.outputs.exists }} - ty: + python-code-check: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - - uses: javidahmed64592/actions-template-python/actions/ci/ty@main + - uses: javidahmed64592/actions-template-python/actions/setup/setup-uv-python@main + - uses: javidahmed64592/actions-template-python/actions/setup/install-python-dev@main + - uses: javidahmed64592/actions-template-python/actions/ci/python-code-check@main - pytest: + python-tests: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 + - uses: javidahmed64592/actions-template-python/actions/setup/setup-uv-python@main + - uses: javidahmed64592/actions-template-python/actions/setup/install-python-dev@main + - uses: javidahmed64592/actions-template-python/actions/setup/check-tests-exists@main id: check-tests-exists - - uses: javidahmed64592/actions-template-python/actions/ci/pytest@main + + - uses: javidahmed64592/actions-template-python/actions/ci/python-tests@main if: steps.check-tests-exists.outputs.exists == 'true' - bandit: + python-security-check: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - - uses: javidahmed64592/actions-template-python/actions/ci/bandit@main + - uses: javidahmed64592/actions-template-python/actions/setup/setup-uv-python@main + - uses: javidahmed64592/actions-template-python/actions/setup/install-python-dev@main + - uses: javidahmed64592/actions-template-python/actions/ci/python-security-check@main - pip-audit: + npm-code-check: runs-on: ubuntu-latest - continue-on-error: true steps: - uses: actions/checkout@v6 - - uses: javidahmed64592/actions-template-python/actions/ci/pip-audit@main - version-check: + - uses: javidahmed64592/actions-template-python/actions/setup/check-frontend-exists@main + id: check-frontend-exists + + - uses: javidahmed64592/actions-template-python/actions/setup/setup-node@main + if: steps.check-frontend-exists.outputs.exists == 'true' + + - uses: javidahmed64592/actions-template-python/actions/ci/npm-code-check@main + if: steps.check-frontend-exists.outputs.exists == 'true' + + npm-tests: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - - uses: javidahmed64592/actions-template-python/actions/ci/version-check@main - with: - frontend-dir-exists: false + + - uses: javidahmed64592/actions-template-python/actions/setup/check-frontend-exists@main + id: check-frontend-exists + + - uses: javidahmed64592/actions-template-python/actions/setup/setup-node@main + if: steps.check-frontend-exists.outputs.exists == 'true' + + - uses: javidahmed64592/actions-template-python/actions/ci/npm-tests@main + if: steps.check-frontend-exists.outputs.exists == 'true' diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 55ef55c..a4cea11 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -5,14 +5,14 @@ on: branches: - main pull_request: - branches: - - main jobs: build-docs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 + - uses: javidahmed64592/actions-template-python/actions/setup/setup-uv-python@main + - uses: javidahmed64592/actions-template-python/actions/setup/install-python-docs@main - uses: javidahmed64592/actions-template-python/actions/docs/build-docs@main publish-docs: From 841243081afcb71dbdd16aaddd36901d558a3a5c Mon Sep 17 00:00:00 2001 From: Javid Ahmed Date: Sat, 6 Jun 2026 21:23:23 +0100 Subject: [PATCH 2/3] Add virtual environment creation step in verify-structure job --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ff1f803..82b5a4a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,10 @@ jobs: needs: build-wheel steps: - uses: actions/checkout@v6 + - uses: javidahmed64592/actions-template-python/actions/setup/setup-uv-python@main + with: + create-venv: true - uses: javidahmed64592/actions-template-python/actions/build/verify-structure@main with: frontend-dir-exists: false From e90f112863635ea305bd036b3b73a7cc7b1d157a Mon Sep 17 00:00:00 2001 From: Javid Ahmed Date: Sat, 6 Jun 2026 21:28:54 +0100 Subject: [PATCH 3/3] Refactor build workflow to include frontend existence check and update frontend-dir-exists condition in verify-structure job --- .github/workflows/build.yml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 82b5a4a..abb1a4c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,12 +7,36 @@ on: pull_request: jobs: + build-frontend: + runs-on: ubuntu-latest + outputs: + frontend-exists: ${{ steps.check-frontend-exists.outputs.exists }} + steps: + - uses: actions/checkout@v6 + + - uses: javidahmed64592/actions-template-python/actions/setup/check-frontend-exists@main + id: check-frontend-exists + + - uses: javidahmed64592/actions-template-python/actions/build/build-frontend@main + if: steps.check-frontend-exists.outputs.exists == 'true' + build-wheel: runs-on: ubuntu-latest + needs: build-frontend + outputs: + frontend-exists: ${{ needs.build-frontend.outputs.frontend-exists }} steps: - uses: actions/checkout@v6 - uses: javidahmed64592/actions-template-python/actions/setup/setup-uv-python@main - uses: javidahmed64592/actions-template-python/actions/setup/install-python-core@main + + - name: Download frontend build + if: needs.build-frontend.outputs.frontend-exists == 'true' + uses: actions/download-artifact@v8 + with: + name: ${{ github.event.repository.name }}-frontend-build + path: static + - uses: javidahmed64592/actions-template-python/actions/build/build-wheel@main verify-structure: @@ -26,4 +50,4 @@ jobs: create-venv: true - uses: javidahmed64592/actions-template-python/actions/build/verify-structure@main with: - frontend-dir-exists: false + frontend-dir-exists: ${{ needs.build-wheel.outputs.frontend-exists }}