-
Notifications
You must be signed in to change notification settings - Fork 499
94 lines (80 loc) · 3.66 KB
/
Copy pathci-integrate.yml
File metadata and controls
94 lines (80 loc) · 3.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: "CI integrations | CPU"
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
on: # Trigger the workflow on push or pull request, but only for the master branch
push:
branches: [master, "release/*"]
pull_request:
branches: [master, "release/*"]
types: [opened, reopened, ready_for_review, synchronize]
schedule:
# At the end of every day
- cron: "0 0 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
cancel-in-progress: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
defaults:
run:
shell: bash
jobs:
pytest:
runs-on: ${{ matrix.os }}
if: github.event.pull_request.draft == false
strategy:
fail-fast: false
matrix:
os: ["ubuntu-22.04", "macOS-14", "windows-2022"]
python-version: ["3.10", "3.11"]
requires: ["oldest", "latest"]
# exclude:
# - { python-version: "3.10", requires: "oldest" }
# - { python-version: "3.10", os: "windows" } # todo: https://discuss.pytorch.org/t/numpy-is-not-available-error/146192
env:
FREEZE_REQUIREMENTS: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
UV_TORCH_BACKEND: "cpu"
# TODO: Remove this - Enable running MPS tests on this platform
DISABLE_MPS: ${{ startsWith(matrix.os, 'macOS') && '1' || '0' }}
# Supply-chain guard: refuse PyPI releases newer than 2 days. See https://docs.astral.sh/uv/reference/settings/#exclude-newer
UV_EXCLUDE_NEWER: "2 days"
# Timeout: https://stackoverflow.com/a/59076067/4521646
# seems that MacOS jobs take much more than orger OS
timeout-minutes: 45
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install uv and set Python version
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
with:
python-version: ${{ matrix.python-version }}
# TODO: Avoid activating environment like this
# see: https://github.com/astral-sh/setup-uv/tree/v6/?tab=readme-ov-file#activate-environment
activate-environment: true
enable-cache: true
- run: uv pip install -r requirements/_ci.txt
- name: source cashing
uses: ./.github/actions/pull-caches
with:
requires: ${{ matrix.requires }}
- name: set oldest if/only for integrations
if: matrix.requires == 'oldest'
run: python .github/assistant.py set-oldest-versions --req_files='["requirements/_integrate.txt"]'
- name: Install all dependencies
run: |
# this was updated in `source cashing` by optional oldest
cat requirements/_integrate.txt
# to have install pyTorch
uv pip install -e . "setuptools==69.5.1" --extra-index-url=${PYTORCH_URL}
# adjust version to PT ecosystem based on installed TM
python -m wget https://raw.githubusercontent.com/Lightning-AI/utilities/main/scripts/adjust-torch-versions.py
# make it as a loop over all files in `requirements`
for req in requirements/*.txt; do
python adjust-torch-versions.py "$req"
done
# install package and dependencies
uv pip install -e . -r requirements/_tests.txt -r requirements/_integrate.txt
uv pip list
- name: Integrations
working-directory: ./tests
env:
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION: "python"
run: python -m pytest integrations -v --durations=25 --reruns 3 --reruns-delay 2
- name: Minimize uv cache
run: uv cache prune --ci