-
Notifications
You must be signed in to change notification settings - Fork 4
122 lines (104 loc) · 3.59 KB
/
Copy pathpython-checks.yml
File metadata and controls
122 lines (104 loc) · 3.59 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: Python checks
on:
pull_request:
push:
branches:
- main
- master
- maintenance
workflow_dispatch:
schedule:
# Weekly full-stack run so botorch/torch API drift in the pinned
# requirements is caught even though PR runs use lightweight stubs.
- cron: "0 6 * * 1"
permissions:
contents: read
jobs:
python-tests:
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
python-version:
- "3.11"
- "3.12"
- "3.13"
- "3.14"
env:
PYTHONDONTWRITEBYTECODE: "1"
steps:
- name: Check out repository
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
python -m pip install numpy pandas
- name: Check patch whitespace
shell: bash
run: |
pathspecs=(
"."
":(exclude)**/*.unity"
":(exclude)**/*.prefab"
":(exclude)**/*.asset"
":(exclude)**/*.meta"
)
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
git diff --check "${{ github.event.pull_request.base.sha }}" HEAD -- "${pathspecs[@]}"
else
git diff-tree --check --no-commit-id --root -r HEAD -- "${pathspecs[@]}"
fi
- name: Check generated Python caches are not tracked
shell: bash
run: |
if git ls-files | grep -E '(^|/)__pycache__(/|$)|\.py[co]$|\.pyo$'; then
echo "Generated Python cache artifacts must not be tracked."
exit 1
fi
- name: Run Python unit tests
run: python -m unittest discover tests
- name: Check tests did not create Python caches
shell: bash
run: |
cache_file="$(find . \( -type d -name __pycache__ -o -type f \( -name '*.pyc' -o -name '*.pyo' \) \) -print -quit)"
if [[ -n "$cache_file" ]]; then
echo "Generated Python cache artifact found: $cache_file"
exit 1
fi
full-stack-tests:
# Runs the complete suite against the real pinned dependency stack
# (torch/botorch/moocore/scipy/sklearn), including the integration and
# CABOP tests that are skipped in the lightweight job above. Weekly and
# on manual dispatch only, because the stack download is large.
name: Full-stack tests (real botorch)
runs-on: ubuntu-latest
timeout-minutes: 45
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
env:
PYTHONDONTWRITEBYTECODE: "1"
steps:
- name: Check out repository
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
cache: pip
- name: Install pinned dependency stack (CPU torch)
run: |
python -m pip install --upgrade pip
# Install the CPU wheel first so the pinned torch requirement is
# satisfied without pulling the multi-GB CUDA distribution.
python -m pip install "torch==2.13.0" --index-url https://download.pytorch.org/whl/cpu
python -m pip install -r Assets/StreamingAssets/BOData/Installation/requirements.txt
- name: Run full test suite (integration + CABOP included)
run: python -m unittest discover tests -v