-
Notifications
You must be signed in to change notification settings - Fork 532
58 lines (54 loc) · 1.74 KB
/
pytest.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
name: Python Tests
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- master
- 'releases/**'
pull_request:
branches:
- master
- 'releases/**'
jobs:
python-test:
strategy:
matrix:
python-version: [3.8]
test-path:
- tests/unit_tests
- tests/test_api.py
- tests/test_cli.py
- tests/test_config.py
- tests/test_global_user_state.py
- tests/test_jobs.py
- tests/test_list_accelerators.py
- tests/test_optimizer_dryruns.py
- tests/test_optimizer_random_dag.py
- tests/test_storage.py
- tests/test_wheels.py
- tests/test_jobs_and_serve.py
- tests/test_yaml_parser.py
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache dependencies
uses: actions/cache@v3
if: startsWith(runner.os, 'Linux')
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-pytest-${{ matrix.python-version }}
restore-keys: |
${{ runner.os }}-pip-pytest-${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ".[all]"
pip install pytest pytest-xdist pytest-env>=0.6 memory-profiler==0.61.0
- name: Run tests with pytest
run: SKYPILOT_DISABLE_USAGE_COLLECTION=1 SKYPILOT_SKIP_CLOUD_IDENTITY_CHECK=1 pytest -n 1 --dist no ${{ matrix.test-path }}