-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Test] Rework PR Gate #780
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
c6669f5
Experiments in reworking the unit tests
riedgar-ms 6130522
Another little rethink
riedgar-ms 2749f81
Typo
riedgar-ms df73de4
Foolish mistake
riedgar-ms 5116ba4
Rework a little more
riedgar-ms e6726be
Correct array
riedgar-ms 3ca1354
More rethinking
riedgar-ms 9e92d26
Typo
riedgar-ms 49d6229
Fixes and remove another file
riedgar-ms c0b8298
Fix dependencies
riedgar-ms d230d43
Trying to improve
riedgar-ms 53c2397
Syntax correction
riedgar-ms c88ee97
Correcting dependencies
riedgar-ms 1b6a810
Argument names
riedgar-ms fa6684b
Forgot some matrices
riedgar-ms f8b39a8
'latest' isn't a concept :-(
riedgar-ms 21e8e80
Rethink a little
riedgar-ms 5c70173
Simpler
riedgar-ms d649d59
Simple minimal action
riedgar-ms bddccb9
Oops
riedgar-ms 92bfaeb
Expand on idea
riedgar-ms 81587f8
black can be stable?
riedgar-ms da17549
Bump action version
riedgar-ms beb6ca4
Correct Rust installation
riedgar-ms e9b4321
Fix version
riedgar-ms 1e69878
Convert server tests to an action
riedgar-ms 9dab756
Hook in server tests
riedgar-ms 9e7571e
Rename workflow file
riedgar-ms File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 20 additions & 13 deletions
33
.github/workflows/unit_tests.yml → ...hub/workflows/action_plain_unit_tests.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 12 additions & 13 deletions
25
.github/workflows/server_tests.yml → .github/workflows/action_server_tests.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
name: Pull Request Gate | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
# First Stage ======================================================================= | ||
# Linting and basic CPU-based tests | ||
|
||
linting-black: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
# https://black.readthedocs.io/en/stable/integrations/github_actions.html | ||
- uses: psf/black@stable | ||
with: | ||
options: "--diff" # Remove this to start enforcement | ||
|
||
linting-mypy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.8 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install .[all,test] | ||
- name: Run mypy | ||
run: | | ||
python -m mypy guidance | ||
|
||
bare-install: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-12] | ||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Minimal install | ||
run: | | ||
pip install -e . | ||
- name: Attempt import | ||
run: | | ||
python -c "import guidance" | ||
|
||
|
||
unit-tests-linux-python-latest: | ||
uses: ./.github/workflows/action_plain_unit_tests.yml | ||
with: | ||
os: ubuntu-latest | ||
python-version: "3.12" | ||
|
||
end-stage-1: | ||
needs: | ||
- linting-black | ||
- linting-mypy | ||
- bare-install | ||
- unit-tests-linux-python-latest | ||
name: End Stage 1 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: echo "End of Stage 1" | ||
|
||
# Second stage ======================================================================= | ||
# Remaining CPU-based tests on Linux, plus server tests and basic GPU testing | ||
|
||
|
||
unit-tests-gpu-python-latest: | ||
needs: end-stage-1 | ||
uses: ./.github/workflows/action_gpu_unit_tests.yml | ||
with: | ||
os: gpu-runner | ||
python-version: "3.12" | ||
|
||
unit-tests-linux-python-other: | ||
needs: end-stage-1 | ||
strategy: | ||
fail-fast: false # Don't cancel all on first failure | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
uses: ./.github/workflows/action_plain_unit_tests.yml | ||
with: | ||
os: ubuntu-latest | ||
python-version: ${{ matrix.python-version }} | ||
|
||
server-tests: | ||
needs: end-stage-1 | ||
strategy: | ||
fail-fast: false # Don't cancel all on first failure | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
uses: ./.github/workflows/action_server_tests.yml | ||
with: | ||
os: ubuntu-latest | ||
python-version: ${{ matrix.python-version }} | ||
|
||
|
||
|
||
end-stage-2: | ||
needs: | ||
- unit-tests-linux-python-other | ||
- unit-tests-gpu-python-latest | ||
name: End Stage 2 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: echo "End of Stage 1" | ||
|
||
# Third Stage ============================================================== | ||
# Windows and MacOS, plus other GPU Linux tests | ||
|
||
unit-tests-win: | ||
needs: end-stage-2 | ||
strategy: | ||
fail-fast: false # Don't cancel all on first failure | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
uses: ./.github/workflows/action_plain_unit_tests.yml | ||
with: | ||
os: windows-latest | ||
python-version: ${{ matrix.python-version }} | ||
|
||
unit-tests-mac: | ||
needs: end-stage-2 | ||
strategy: | ||
fail-fast: false # Don't cancel all on first failure | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
uses: ./.github/workflows/action_plain_unit_tests.yml | ||
with: | ||
os: macos-12 | ||
python-version: ${{ matrix.python-version }} | ||
|
||
unit-tests-gpu-python-others: | ||
needs: end-stage-2 | ||
strategy: | ||
fail-fast: false # Don't cancel all on first failure | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
uses: ./.github/workflows/action_gpu_unit_tests.yml | ||
with: | ||
os: gpu-runner | ||
python-version: ${{ matrix.python-version }} | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Appreciate the cascaded staging :), and the structure seems reasonable!