-
Notifications
You must be signed in to change notification settings - Fork 409
79 lines (69 loc) · 3 KB
/
ci-integrate.yml
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
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-20.04, macOS-11, windows-2022]
python-version: ["3.8", "3.10"]
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
include:
- { python-version: "3.10", requires: "latest", os: "ubuntu-22.04" }
- { python-version: "3.10", requires: "latest", os: "macOS-12" }
env:
PYTORCH_URL: "https://download.pytorch.org/whl/cpu/torch_stable.html"
FREEZE_REQUIREMENTS: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
PYPI_CACHE: "_ci-cache_PyPI"
# Timeout: https://stackoverflow.com/a/59076067/4521646
# seems that MacOS jobs take much more than orger OS
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: source cashing
uses: ./.github/actions/pull-caches
with:
requires: ${{ matrix.requires }}
- name: Freeze PIL (hotfix)
# import of PILLOW_VERSION which they recently removed in v9.0 in favor of __version__
run: pip install "Pillow<9.0" # It messes with torchvision
- name: Install all dependencies
run: |
set -e
curl https://raw.githubusercontent.com/Lightning-AI/utilities/main/scripts/adjust-torch-versions.py -o adjust-torch-versions.py
pip install -r requirements/test.txt -r requirements/integrate.txt \
--find-links $PYTORCH_URL -f $PYPI_CACHE --upgrade-strategy eager
python adjust-torch-versions.py requirements/base.txt
python adjust-torch-versions.py requirements/image.txt
cat requirements/base.txt
pip install -e . --find-links $PYTORCH_URL -f $PYPI_CACHE
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