Skip to content

Commit b9433b6

Browse files
committed
Swtich out
1 parent 082d9f6 commit b9433b6

File tree

2 files changed

+100
-72
lines changed

2 files changed

+100
-72
lines changed

.github/workflows/ci-additional.yaml

-72
Original file line numberDiff line numberDiff line change
@@ -81,78 +81,6 @@ jobs:
8181
# [MHS, 01/25/2024] Skip datatree_ documentation remove after #8572
8282
python -m pytest --doctest-modules xarray --ignore xarray/tests --ignore xarray/datatree_ -Werror
8383
84-
hypothesis:
85-
name: Slow Hypothesis Tests
86-
runs-on: "ubuntu-latest"
87-
needs: detect-ci-trigger
88-
if: |
89-
always()
90-
&& (
91-
(github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
92-
|| needs.detect-ci-trigger.outputs.triggered == 'true'
93-
|| contains( github.event.pull_request.labels.*.name, 'run-slow-hypothesis')
94-
)
95-
defaults:
96-
run:
97-
shell: bash -l {0}
98-
99-
env:
100-
CONDA_ENV_FILE: ci/requirements/environment.yml
101-
PYTHON_VERSION: "3.12"
102-
103-
steps:
104-
- uses: actions/checkout@v4
105-
with:
106-
fetch-depth: 0 # Fetch all history for all branches and tags.
107-
108-
- name: set environment variables
109-
run: |
110-
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
111-
112-
- name: Setup micromamba
113-
uses: mamba-org/setup-micromamba@v1
114-
with:
115-
environment-file: ${{env.CONDA_ENV_FILE}}
116-
environment-name: xarray-tests
117-
create-args: >-
118-
python=${{env.PYTHON_VERSION}}
119-
conda
120-
cache-environment: true
121-
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
122-
123-
- name: Install xarray
124-
run: |
125-
python -m pip install --no-deps -e .
126-
- name: Version info
127-
run: |
128-
conda info -a
129-
conda list
130-
python xarray/util/print_versions.py
131-
- name: Restore cached hypothesis directory
132-
uses: actions/cache@v4
133-
with:
134-
path: .hypothesis/
135-
key: cache-hypothesis
136-
enableCrossOsArchive: true
137-
save-always: true
138-
- name: Run slow Hypothesis tests
139-
if: success()
140-
id: status
141-
run: |
142-
python -m pytest --hypothesis-show-statistics --run-slow-hypothesis properties/*.py \
143-
--report-log output-${{ matrix.python-version }}-log.jsonl
144-
- name: Generate and publish the report
145-
if: |
146-
failure()
147-
&& steps.status.outcome == 'failure'
148-
&& github.event_name == 'schedule'
149-
&& github.repository_owner == 'pydata'
150-
uses: xarray-contrib/issue-from-pytest-log@v1
151-
with:
152-
log-path: output-${{ matrix.python-version }}-log.jsonl
153-
issue-title: "Nightly Hypothesis tests failed"
154-
issue-label: "topic-hypothesis"
155-
15684
mypy:
15785
name: Mypy
15886
runs-on: "ubuntu-latest"

.github/workflows/hypothesis.yaml

+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Slow Hypothesis CI
2+
on:
3+
push:
4+
branches:
5+
- "main"
6+
pull_request:
7+
branches:
8+
- "main"
9+
types: [opened, reopened, synchronize, labeled]
10+
workflow_dispatch: # allows you to trigger manually
11+
12+
jobs:
13+
detect-ci-trigger:
14+
name: detect ci trigger
15+
runs-on: ubuntu-latest
16+
if: |
17+
github.repository == 'pydata/xarray'
18+
&& (github.event_name == 'push' || github.event_name == 'pull_request')
19+
outputs:
20+
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 2
25+
- uses: xarray-contrib/ci-trigger@v1
26+
id: detect-trigger
27+
with:
28+
keyword: "[skip-ci]"
29+
30+
hypothesis:
31+
name: Slow Hypothesis Tests
32+
runs-on: "ubuntu-latest"
33+
needs: detect-ci-trigger
34+
if: |
35+
always()
36+
&& (
37+
(github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
38+
|| needs.detect-ci-trigger.outputs.triggered == 'true'
39+
|| contains( github.event.pull_request.labels.*.name, 'run-slow-hypothesis')
40+
)
41+
defaults:
42+
run:
43+
shell: bash -l {0}
44+
45+
env:
46+
CONDA_ENV_FILE: ci/requirements/environment.yml
47+
PYTHON_VERSION: "3.12"
48+
49+
steps:
50+
- uses: actions/checkout@v4
51+
with:
52+
fetch-depth: 0 # Fetch all history for all branches and tags.
53+
54+
- name: set environment variables
55+
run: |
56+
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
57+
58+
- name: Setup micromamba
59+
uses: mamba-org/setup-micromamba@v1
60+
with:
61+
environment-file: ${{env.CONDA_ENV_FILE}}
62+
environment-name: xarray-tests
63+
create-args: >-
64+
python=${{env.PYTHON_VERSION}}
65+
conda
66+
cache-environment: true
67+
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
68+
69+
- name: Install xarray
70+
run: |
71+
python -m pip install --no-deps -e .
72+
- name: Version info
73+
run: |
74+
conda info -a
75+
conda list
76+
python xarray/util/print_versions.py
77+
- name: Restore cached hypothesis directory
78+
uses: actions/cache@v4
79+
with:
80+
path: .hypothesis/
81+
key: cache-hypothesis
82+
enableCrossOsArchive: true
83+
save-always: true
84+
- name: Run slow Hypothesis tests
85+
if: success()
86+
id: status
87+
run: |
88+
python -m pytest --hypothesis-show-statistics --run-slow-hypothesis properties/*.py \
89+
--report-log output-${{ matrix.python-version }}-log.jsonl
90+
- name: Generate and publish the report
91+
if: |
92+
failure()
93+
&& steps.status.outcome == 'failure'
94+
&& github.event_name == 'schedule'
95+
&& github.repository_owner == 'pydata'
96+
uses: xarray-contrib/issue-from-pytest-log@v1
97+
with:
98+
log-path: output-${{ matrix.python-version }}-log.jsonl
99+
issue-title: "Nightly Hypothesis tests failed"
100+
issue-label: "topic-hypothesis"

0 commit comments

Comments
 (0)