-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into plot1d_lines
- Loading branch information
Showing
58 changed files
with
1,453 additions
and
678 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,14 +35,13 @@ jobs: | |
runs-on: "ubuntu-latest" | ||
needs: detect-ci-trigger | ||
if: needs.detect-ci-trigger.outputs.triggered == 'false' | ||
|
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
env: | ||
CONDA_ENV_FILE: ci/requirements/environment.yml | ||
PYTHON_VERSION: "3.11" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
|
@@ -128,7 +127,7 @@ jobs: | |
python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report xarray/ | ||
- name: Upload mypy coverage to Codecov | ||
uses: codecov/[email protected].0 | ||
uses: codecov/[email protected].1 | ||
with: | ||
file: mypy_report/cobertura.xml | ||
flags: mypy | ||
|
@@ -182,7 +181,7 @@ jobs: | |
python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report xarray/ | ||
- name: Upload mypy coverage to Codecov | ||
uses: codecov/[email protected].0 | ||
uses: codecov/[email protected].1 | ||
with: | ||
file: mypy_report/cobertura.xml | ||
flags: mypy39 | ||
|
@@ -243,7 +242,7 @@ jobs: | |
python -m pyright xarray/ | ||
- name: Upload pyright coverage to Codecov | ||
uses: codecov/[email protected].0 | ||
uses: codecov/[email protected].1 | ||
with: | ||
file: pyright_report/cobertura.xml | ||
flags: pyright | ||
|
@@ -302,7 +301,7 @@ jobs: | |
python -m pyright xarray/ | ||
- name: Upload pyright coverage to Codecov | ||
uses: codecov/[email protected].0 | ||
uses: codecov/[email protected].1 | ||
with: | ||
file: pyright_report/cobertura.xml | ||
flags: pyright39 | ||
|
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 |
---|---|---|
|
@@ -127,6 +127,14 @@ jobs: | |
run: | | ||
python -c "import xarray" | ||
- name: Restore cached hypothesis directory | ||
uses: actions/cache@v4 | ||
with: | ||
path: .hypothesis/ | ||
key: cache-hypothesis | ||
enableCrossOsArchive: true | ||
save-always: true | ||
|
||
- name: Run tests | ||
run: python -m pytest -n 4 | ||
--timeout 180 | ||
|
@@ -143,7 +151,7 @@ jobs: | |
path: pytest.xml | ||
|
||
- name: Upload code coverage to Codecov | ||
uses: codecov/[email protected].0 | ||
uses: codecov/[email protected].1 | ||
with: | ||
file: ./coverage.xml | ||
flags: unittests | ||
|
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,116 @@ | ||
name: Slow Hypothesis CI | ||
on: | ||
push: | ||
branches: | ||
- "main" | ||
pull_request: | ||
branches: | ||
- "main" | ||
types: [opened, reopened, synchronize, labeled] | ||
schedule: | ||
- cron: "0 0 * * *" # Daily “At 00:00” UTC | ||
workflow_dispatch: # allows you to trigger manually | ||
|
||
jobs: | ||
detect-ci-trigger: | ||
name: detect ci trigger | ||
runs-on: ubuntu-latest | ||
if: | | ||
github.repository == 'pydata/xarray' | ||
&& (github.event_name == 'push' || github.event_name == 'pull_request') | ||
outputs: | ||
triggered: ${{ steps.detect-trigger.outputs.trigger-found }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 2 | ||
- uses: xarray-contrib/ci-trigger@v1 | ||
id: detect-trigger | ||
with: | ||
keyword: "[skip-ci]" | ||
|
||
hypothesis: | ||
name: Slow Hypothesis Tests | ||
runs-on: "ubuntu-latest" | ||
needs: detect-ci-trigger | ||
if: | | ||
always() | ||
&& ( | ||
(github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') | ||
|| needs.detect-ci-trigger.outputs.triggered == 'true' | ||
|| contains( github.event.pull_request.labels.*.name, 'run-slow-hypothesis') | ||
) | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
env: | ||
CONDA_ENV_FILE: ci/requirements/environment.yml | ||
PYTHON_VERSION: "3.12" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Fetch all history for all branches and tags. | ||
|
||
- name: set environment variables | ||
run: | | ||
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | ||
- name: Setup micromamba | ||
uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
environment-file: ci/requirements/environment.yml | ||
environment-name: xarray-tests | ||
create-args: >- | ||
python=${{env.PYTHON_VERSION}} | ||
pytest-reportlog | ||
cache-environment: true | ||
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}" | ||
|
||
- name: Install xarray | ||
run: | | ||
python -m pip install --no-deps -e . | ||
- name: Version info | ||
run: | | ||
conda info -a | ||
conda list | ||
python xarray/util/print_versions.py | ||
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache | ||
- name: Restore cached hypothesis directory | ||
id: restore-hypothesis-cache | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: .hypothesis/ | ||
key: cache-hypothesis-${{ runner.os }}-${{ github.run_id }} | ||
restore-keys: | | ||
cache-hypothesis- | ||
- name: Run slow Hypothesis tests | ||
if: success() | ||
id: status | ||
run: | | ||
python -m pytest --hypothesis-show-statistics --run-slow-hypothesis properties/*.py \ | ||
--report-log output-${{ matrix.python-version }}-log.jsonl | ||
# explicitly save the cache so it gets updated, also do this even if it fails. | ||
- name: Save cached hypothesis directory | ||
id: save-hypothesis-cache | ||
if: always() && steps.status.outcome != 'skipped' | ||
uses: actions/cache/save@v4 | ||
with: | ||
path: .hypothesis/ | ||
key: cache-hypothesis-${{ runner.os }}-${{ github.run_id }} | ||
|
||
- name: Generate and publish the report | ||
if: | | ||
failure() | ||
&& steps.status.outcome == 'failure' | ||
&& github.event_name == 'schedule' | ||
&& github.repository_owner == 'pydata' | ||
uses: xarray-contrib/issue-from-pytest-log@v1 | ||
with: | ||
log-path: output-${{ matrix.python-version }}-log.jsonl | ||
issue-title: "Nightly Hypothesis tests failed" | ||
issue-label: "topic-hypothesis" |
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 |
---|---|---|
|
@@ -143,7 +143,7 @@ jobs: | |
run: | | ||
python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report | ||
- name: Upload mypy coverage to Codecov | ||
uses: codecov/[email protected].0 | ||
uses: codecov/[email protected].1 | ||
with: | ||
file: mypy_report/cobertura.xml | ||
flags: mypy | ||
|
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
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
Oops, something went wrong.