diff --git a/.github/workflows/README.md b/.github/workflows/README.md new file mode 100644 index 00000000..46414ad5 --- /dev/null +++ b/.github/workflows/README.md @@ -0,0 +1,20 @@ +# GitHub Workflows + +This directory uses a simple split: + +- **Entrypoint workflows** (`push`, `pull_request`, or `workflow_dispatch`) +- **Reusable workflows** (`workflow_call`) that are referenced by entrypoints + +## Entrypoints + +- `ci.yaml` — main CI on `push`/`pull_request` +- `ci-gpu-manual.yaml` — manual GPU test trigger (`workflow_dispatch`) +- `release-step-1-bump.yaml` — manual release bump and GitHub release +- `release-step-2-publish.yaml` — PyPI publish, triggered by release completion or manual dispatch + +## Reusable Workflows + +- `ci-reusable-pre-commit.yaml` +- `ci-reusable-tests-cpu.yaml` +- `ci-reusable-tests-gpu.yaml` +- `ci-reusable-build-docker-image.yaml` diff --git a/.github/workflows/ci-gpu-manual.yaml b/.github/workflows/ci-gpu-manual.yaml new file mode 100644 index 00000000..11700e1d --- /dev/null +++ b/.github/workflows/ci-gpu-manual.yaml @@ -0,0 +1,9 @@ +name: '[GPU] mostlyai Tests (Manual)' + +on: + workflow_dispatch: + +jobs: + run-tests-gpu: + uses: ./.github/workflows/ci-reusable-tests-gpu.yaml + secrets: inherit diff --git a/.github/workflows/build-docker-image.yaml b/.github/workflows/ci-reusable-build-docker-image.yaml similarity index 100% rename from .github/workflows/build-docker-image.yaml rename to .github/workflows/ci-reusable-build-docker-image.yaml diff --git a/.github/workflows/pre-commit-check.yaml b/.github/workflows/ci-reusable-pre-commit.yaml similarity index 100% rename from .github/workflows/pre-commit-check.yaml rename to .github/workflows/ci-reusable-pre-commit.yaml diff --git a/.github/workflows/run-tests-cpu.yaml b/.github/workflows/ci-reusable-tests-cpu.yaml similarity index 100% rename from .github/workflows/run-tests-cpu.yaml rename to .github/workflows/ci-reusable-tests-cpu.yaml diff --git a/.github/workflows/run-tests-gpu.yaml b/.github/workflows/ci-reusable-tests-gpu.yaml similarity index 100% rename from .github/workflows/run-tests-gpu.yaml rename to .github/workflows/ci-reusable-tests-gpu.yaml diff --git a/.github/workflows/workflow.yaml b/.github/workflows/ci.yaml similarity index 53% rename from .github/workflows/workflow.yaml rename to .github/workflows/ci.yaml index 329243f9..585add3d 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/ci.yaml @@ -10,27 +10,13 @@ jobs: if: | github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) - uses: ./.github/workflows/pre-commit-check.yaml + uses: ./.github/workflows/ci-reusable-pre-commit.yaml secrets: inherit run-tests-cpu: if: | github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) - uses: ./.github/workflows/run-tests-cpu.yaml - secrets: inherit - run-tests-gpu: - if: | - ( - github.event_name == 'push' || - (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) - ) && - ( - github.ref == 'refs/heads/main' || - startsWith(github.ref, 'refs/tags/') || - contains(github.event.head_commit.message, '[gpu]') || - contains(github.event.pull_request.title, '[gpu]') - ) - uses: ./.github/workflows/run-tests-gpu.yaml + uses: ./.github/workflows/ci-reusable-tests-cpu.yaml secrets: inherit build-docker-image: if: | @@ -42,6 +28,6 @@ jobs: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') ) - needs: [pre-commit-check, run-tests-cpu, run-tests-gpu] + needs: [pre-commit-check, run-tests-cpu] secrets: inherit - uses: ./.github/workflows/build-docker-image.yaml + uses: ./.github/workflows/ci-reusable-build-docker-image.yaml