-
Notifications
You must be signed in to change notification settings - Fork 108
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
Run everest tests before publishing to pypi #8756
Merged
Merged
Changes from all commits
Commits
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
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 |
---|---|---|
@@ -1,79 +1,87 @@ | ||
name: everest-run-tests-build-docs | ||
|
||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
tags: "*" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | ||
workflow_call: | ||
inputs: | ||
os: | ||
type: string | ||
python-version: | ||
type: string | ||
test-type: | ||
type: string | ||
|
||
env: | ||
NO_PROJECT_RES: 1 | ||
UV_SYSTEM_PYTHON: 1 | ||
|
||
jobs: | ||
tests: | ||
name: "py_${{ matrix.python-version }}_${{ matrix.test_type }}" | ||
tests-everest: | ||
name: Run everest tests | ||
timeout-minutes: 60 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.8', '3.11', '3.12'] | ||
os: [ubuntu-latest] | ||
test_type: ['doc', 'ui-test', 'test', 'integration-test', 'everest-models-test'] | ||
runs-on: ${{ matrix.os }} | ||
runs-on: ${{ inputs.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
|
||
- name: Set up Python ${{ inputs.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
python-version: ${{ inputs.python-version }} | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v3 | ||
|
||
- name: Install HDF5 source files on mac | ||
if: ${{ inputs.os == 'macOS' && (inputs.python-version == '3.8' || inputs.python-version == '3.9' )}} | ||
run: brew install hdf5 | ||
|
||
- name: Install Everest and dependencies | ||
run: | | ||
uv pip install ".[dev,everest]" | ||
|
||
- name: Run Tests | ||
if: matrix.test_type == 'test' | ||
- name: Run Tests Linux | ||
if: ${{ inputs.test-type == 'test' && inputs.os != 'macOS'}} | ||
run: | | ||
pytest tests/everest -n 4 -m "not ui_test and not integration_test" --dist loadgroup -sv | ||
|
||
- name: Run Integration Tests | ||
if: matrix.test_type == 'integration-test' | ||
- name: Run Tests macOS | ||
if: ${{ inputs.test-type == 'test' && inputs.os == 'macOS'}} | ||
run: | | ||
python -m pytest tests/everest -n 4 -m "not ui_test and not integration_test and not fails_on_macos_github_workflow" --dist loadgroup -sv | ||
|
||
- name: Run Integration Tests Linux | ||
if: ${{inputs.test-type == 'integration-test' && inputs.os != 'macOS'}} | ||
run: | | ||
pytest tests/everest -n 4 -m "integration_test" --dist loadgroup | ||
|
||
- name: Run Integration Tests macOS | ||
if: ${{inputs.test-type == 'integration-test' && inputs.os == 'macOS'}} | ||
run: | | ||
python -m pytest tests/everest -n 4 -m "integration_test and not fails_on_macos_github_workflow" --dist loadgroup | ||
|
||
- name: Run UI Tests | ||
if: matrix.test_type == 'ui-test' | ||
if: inputs.test-type == 'ui-test' | ||
env: | ||
QT_QPA_PLATFORM: 'minimal' | ||
run: | | ||
python -m pytest tests/everest -m "ui_test" | ||
|
||
- name: Build Documentation | ||
if: matrix.test_type == 'doc' | ||
if: inputs.test-type == 'doc' | ||
run: | | ||
uv pip install git+https://github.com/equinor/everest-models.git | ||
mkdir tmp | ||
sphinx-build -n -v -E -W ./docs/everest ./tmp/everest_docs | ||
|
||
- name: Run tests requiring everest-models | ||
if: matrix.test_type == 'everest-models-test' | ||
if: inputs.test-type == 'everest-models-test' | ||
run: | | ||
uv pip install git+https://github.com/equinor/everest-models.git | ||
python -m pytest tests/everest -n 4 -m everest_models_test --dist loadgroup | ||
|
||
- name: Test docs entry point | ||
if: matrix.test_type == 'everest-docs-entry-test' | ||
if: inputs.test-type == 'everest-docs-entry-test' | ||
run: | | ||
python -m everest.docs |
This file was deleted.
Oops, something went wrong.
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.
I would suggest maybe combining this and the test doc entry points, and making it a separate step in the build and test workflow, so that it can be run only once for one python version to reduce the number of total workflows run? Similar to how we test the building of the ert docs.
But this can probably be done later in another pr.
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.
Added so docs are only build for py312