diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9f4f45b..abb1a4c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,14 +5,38 @@ on: branches: - main pull_request: - branches: - - main 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: @@ -20,6 +44,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 + frontend-dir-exists: ${{ needs.build-wheel.outputs.frontend-exists }} 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: