Debian Codegraph @

.github/workflows/tests.yml

raw
1 name: Tests
2
3 on:
4 push:
5 pull_request:
6 workflow_dispatch:
7 schedule:
8 - cron: "0 6,18 * * *"
9
10 # When this workflow is queued, automatically cancel any previous running
11 # or pending jobs from the same branch
12 concurrency:
13 group: ${{ github.ref }}
14 cancel-in-progress: true
15
16 # Required shell entrypoint to have properly activated conda environments
17 defaults:
18 run:
19 shell: bash -l {0}
20
21 jobs:
22 test:
23 runs-on: ${{ matrix.os }}
24 timeout-minutes: 90
25 strategy:
26 fail-fast: false
27 matrix:
28 os: ["windows-latest", "ubuntu-latest", "macos-14"]
29 environment: ["3.10", "3.11", "3.12", "3.13"]
30 extra: [null]
31 exclude:
32 - os: "macos-14"
33 environment: "3.10"
34 - os: "macos-14"
35 environment: "3.11"
36 - os: "macos-14"
37 environment: "3.13"
38 include:
39 # Minimum dependencies
40 - os: "ubuntu-latest"
41 environment: "mindeps-array"
42 - os: "ubuntu-latest"
43 environment: "mindeps-dataframe"
44 - os: "ubuntu-latest"
45 environment: "mindeps-distributed"
46 - os: "ubuntu-latest"
47 environment: "mindeps-non-optional"
48 - os: "ubuntu-latest"
49 environment: "mindeps-optional"
50 # Experimental setups
51 - os: "ubuntu-latest"
52 environment: "3.12"
53 extra: "pandas-nightly"
54
55 env:
56 PARALLEL: "true"
57 COVERAGE: "true"
58 HDF5_USE_FILE_LOCKING: "FALSE"
59
60 steps:
61 - name: Checkout source
62 uses: actions/[email protected]
63 with:
64 fetch-depth: 0 # Needed by codecov.io
65
66 - name: Setup Java
67 uses: actions/setup-java@v4
68 if: ${{ matrix.os == 'ubuntu-latest' }}
69 with:
70 distribution: "zulu"
71 java-version: "11"
72
73 - name: Setup Conda Environment
74 uses: conda-incubator/[email protected]
75 with:
76 miniforge-version: latest
77 use-mamba: true
78 channel-priority: strict
79 environment-file: continuous_integration/environment-${{ matrix.environment }}.yaml
80 activate-environment: test-environment
81 auto-activate-base: false
82
83 - name: Test pandas nightlies (only with dask-expr)
84 if: ${{ matrix.extra == 'pandas-nightly' }}
85 run: python -m pip install --pre --extra-index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple pandas -U
86
87 - name: Disable query planning for 3.10 builds
88 if: ${{ matrix.environment == '3.10' }}
89 run: |
90 export DASK_DATAFRAME__QUERY_PLANNING="False"
91 echo "DASK_DATAFRAME__QUERY_PLANNING: $DASK_DATAFRAME__QUERY_PLANNING"
92 echo "DASK_DATAFRAME__QUERY_PLANNING=$DASK_DATAFRAME__QUERY_PLANNING" >> $GITHUB_ENV
93
94 - name: Disable auto pyarrow strings for 3.10 builds
95 if: ${{ matrix.environment == '3.10' }}
96 run: |
97 export DASK_DATAFRAME__CONVERT_STRING="False"
98 echo "DASK_DATAFRAME__CONVERT_STRING: $DASK_DATAFRAME__CONVERT_STRING"
99 echo "DASK_DATAFRAME__CONVERT_STRING=$DASK_DATAFRAME__CONVERT_STRING" >> $GITHUB_ENV
100
101 - name: Reconfigure pytest-timeout
102 # No SIGALRM available on Windows
103 if: ${{ matrix.os != 'windows-latest' }}
104 run: sed -i.bak 's/timeout_method = "thread"/timeout_method = "signal"/' pyproject.toml
105
106 - name: Install
107 run: source continuous_integration/scripts/install.sh
108
109 - name: Run tests
110 id: run_tests
111 run: source continuous_integration/scripts/run_tests.sh
112
113 - name: Coverage
114 uses: codecov/codecov-action@v5
115
116 # The environment file is created in continuous_integration/scripts/install.sh
117 # and can be useful when debugging locally
118 - name: Upload conda environment and test results
119 # ensure this runs even if pytest fails
120 if: >
121 always() &&
122 (steps.run_tests.outcome == 'success' || steps.run_tests.outcome == 'failure')
123 uses: actions/upload-artifact@v4
124 with:
125 name: ${{ matrix.os }}-${{ matrix.environment }}-${{ matrix.extra }}
126 path: |
127 pytest.xml
128 env.yaml
129
130 # Publish an artifact for the event; used by publish-test-results.yaml
131 event_file:
132 # Do not run the schedule job on forks
133 if: github.repository == 'dask/dask' || github.event_name != 'schedule'
134 name: "Event File"
135 runs-on: ubuntu-latest
136 steps:
137 - name: Upload
138 uses: actions/upload-artifact@v4
139 with:
140 name: Event File
141 path: ${{ github.event_path }}