Debian Codegraph @

.github/workflows/testing.yml

raw
1 name: Automated Tests
2
3 on:
4 push:
5 branches: master
6 pull_request:
7 branches: master
8
9 jobs:
10 lint:
11 runs-on: ubuntu-latest
12 steps:
13 - uses: actions/checkout@v4
14 - name: Set up Python 3.11
15 uses: actions/setup-python@v5
16 with:
17 python-version: 3.11
18 - name: Install pre-commit
19 shell: bash
20 run: |
21 python -V
22 python -m pip install pre-commit
23 - name: Run pre-commit linters
24 shell: bash
25 run: |
26 pre-commit run --files *
27
28 build:
29 strategy:
30 matrix:
31 os: [ubuntu-latest, windows-latest, macos-latest]
32 python_version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14-dev", "pypy-3.9"]
33 exclude:
34 # Do not test all minor versions on all platforms, especially if they
35 # are not the oldest/newest supported versions
36 - os: windows-latest
37 python_version: 3.8
38 # as of 4/02/2020, psutil won't build under PyPy + Windows
39 - os: windows-latest
40 python_version: "pypy-3.9"
41 - os: macos-latest
42 python_version: 3.8
43 - os: macos-latest
44 # numpy triggers: RuntimeError: Polyfit sanity test emitted a
45 # warning
46 python_version: "pypy-3.9"
47
48 runs-on: ${{ matrix.os }}
49
50 steps:
51 - uses: actions/checkout@v4
52 - name: Set up Python ${{ matrix.python_version }}
53 uses: actions/setup-python@v5
54 with:
55 python-version: ${{ matrix.python_version }}
56 allow-prereleases: true
57 - name: Install project and dependencies
58 shell: bash
59 run: |
60 python -m pip install --upgrade pip
61 python -m pip install -e .
62 python -m pip install -r dev-requirements.txt
63 python ci/install_coverage_subprocess_pth.py
64 export
65 - name: Display Python version
66 shell: bash
67 run: python -c "import sys; print(sys.version)"
68 - name: Test with pytest
69 shell: bash
70 run: |
71 COVERAGE_PROCESS_START=$GITHUB_WORKSPACE/.coveragerc \
72 PYTHONPATH='.:tests' python -m pytest -r s
73 coverage combine --append
74 coverage xml -i
75 - name: Publish coverage results
76 uses: codecov/codecov-action@v3
77 with:
78 token: ${{ secrets.CODECOV_TOKEN }}
79 file: ./coverage.xml
80
81 distributed-downstream-build:
82 runs-on: ubuntu-latest
83 if: "contains(github.event.pull_request.labels.*.name, 'ci distributed') || contains(github.event.pull_request.labels.*.name, 'ci downstream')"
84 env:
85 PROJECT: distributed
86 TEST_REQUIREMENTS: cryptography pytest pytest-asyncio<0.14.0 pytest-timeout pytest-rerunfailures pytest-cov numpy pandas mock bokeh fsspec>=0.3.3 aiohttp pyarrow git+https://github.com/dask/dask
87 PROJECT_URL: https://github.com/dask/distributed.git
88 strategy:
89 matrix:
90 python_version: ["3.10"]
91 steps:
92 - uses: actions/checkout@v4
93 - name: Set up Python
94 uses: actions/setup-python@v5
95 with:
96 python-version: ${{ matrix.python_version }}
97 - name: Install project and dependencies
98 run: |
99 bash ./.github/scripts/install_downstream_project.sh
100 - name: Install developed version of cloudpickle
101 shell: bash
102 run: |
103 python -m pip install -e .
104 - name: Test the downstream project
105 shell: bash
106 run: |
107 # FIXME ipv6-related failures on Ubuntu github actions CI
108 # https://github.com/dask/distributed/issues/4514
109 export DISABLE_IPV6=1
110 # - test_decide_worker_coschedule_order_neighbors is skipped because of:
111 # https://github.com/dask/distributed/issues/8255
112 # - test_client_worker is skipped because it's a time-related test that
113 # randomly fails on CI but seems unrelated to cloudpickle.
114 export PYTEST_ADDOPTS=("-m" "not avoid_ci" "-k" "not test_decide_worker_coschedule_order_neighbors and not test_client_worker")
115 source ./.github/scripts/test_downstream_project.sh
116
117 joblib-downstream-build:
118 runs-on: ubuntu-latest
119 if: "contains(github.event.pull_request.labels.*.name, 'ci joblib') || contains(github.event.pull_request.labels.*.name, 'ci downstream')"
120 env:
121 PROJECT: joblib
122 TEST_REQUIREMENTS: "threadpoolctl pytest numpy distributed"
123 PROJECT_URL: https://github.com/joblib/joblib.git
124 strategy:
125 matrix:
126 python_version: ["3.10"]
127 steps:
128 - uses: actions/checkout@v4
129 - name: Set up Python
130 uses: actions/setup-python@v5
131 with:
132 python-version: ${{ matrix.python_version }}
133 - name: Install project and dependencies
134 run: |
135 bash ./.github/scripts/install_downstream_project.sh
136 - name: Vendor current cloudpickle inside joblib
137 run: |
138 pushd ../joblib/joblib/externals
139 source vendor_cloudpickle.sh ../../../cloudpickle
140 popd
141 - name: Test the downstream project
142 run: |
143 bash ./.github/scripts/test_downstream_project.sh
144
145 loky-downstream-build:
146 runs-on: ubuntu-latest
147 if: "contains(github.event.pull_request.labels.*.name, 'ci loky') || contains(github.event.pull_request.labels.*.name, 'ci downstream')"
148 env:
149 PROJECT: loky
150 TEST_REQUIREMENTS: "pytest psutil"
151 PROJECT_URL: https://github.com/joblib/loky.git
152 strategy:
153 matrix:
154 python_version: ["3.10"]
155 steps:
156 - uses: actions/checkout@v4
157 - name: Set up Python
158 uses: actions/setup-python@v5
159 with:
160 python-version: ${{ matrix.python_version }}
161 - name: Install downstream project and dependencies
162 run: |
163 bash ./.github/scripts/install_downstream_project.sh
164 - name: Install developed version of cloudpickle
165 shell: bash
166 run: |
167 python -m pip install -e .
168 - name: Test the downstream project
169 run: |
170 bash ./.github/scripts/test_downstream_project.sh
171
172 ray-downstream-build:
173 runs-on: ubuntu-latest
174 if: "contains(github.event.pull_request.labels.*.name, 'ci ray') || contains(github.event.pull_request.labels.*.name, 'ci downstream')"
175 env:
176 PROJECT: ray
177 strategy:
178 matrix:
179 python_version: ["3.11"]
180 steps:
181 - uses: actions/checkout@v4
182 - name: Set up Python
183 uses: actions/setup-python@v5
184 with:
185 python-version: ${{ matrix.python_version }}
186 - name: Install project and tests dependencies
187 run: |
188 python -m pip install --upgrade -r dev-requirements.txt setproctitle psutil catboost \
189 https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-3.0.0.dev0-cp311-cp311-manylinux2014_x86_64.whl
190 - name: Test cloudpickle itself
191 run: |
192 COVERAGE_PROCESS_START="$TRAVIS_BUILD_DIR/.coveragerc" PYTHONPATH='.:tests' pytest -r s
193 - name: Patch Ray with the development version of cloudpickle
194 run: |
195 RAY_PACKAGE_DIR=$(python -c "import os, ray; print(os.path.dirname(ray.__file__), flush=True)")
196 cp cloudpickle/cloudpickle.py $RAY_PACKAGE_DIR/cloudpickle/cloudpickle.py
197 rm -rf $RAY_PACKAGE_DIR/cloudpickle/compat.py
198 cp cloudpickle/cloudpickle_fast.py $RAY_PACKAGE_DIR/cloudpickle/cloudpickle_fast.py
199 - name: Fetch the Ray test suite from github
200 run: |
201 pushd ..
202 git clone https://github.com/ray-project/ray.git
203 popd
204 - name: Run some tests from Ray's test suite
205 run: |
206 pushd ../ray/python/ray/tests
207 pytest -vl test_serialization.py::test_simple_serialization
208 pytest -vl test_serialization.py::test_complex_serialization
209 pytest -vl test_basic.py::test_ray_recursive_objects
210 pytest -vl test_serialization.py::test_serialization_final_fallback
211 pytest -vl test_basic.py::test_nested_functions