Repository navigation
70 lines (60 loc) · 1.85 KB
/
Copy pathpython-ci.yml
File metadata and controls
70 lines (60 loc) · 1.85 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
name: python-ci
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
concurrency:
group: python-ci-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: tests (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- python-version: "3.10"
release_gates: true
- python-version: "3.12"
release_gates: false
steps:
- name: Checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: |
pyproject.toml
requirements-dev.txt
- name: Install development and runtime dependencies
run: |
python -m pip install -U pip
python -m pip install -r requirements-dev.txt
python -m pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
python -m pip install -e ".[all]"
python -m pip check
- name: Repository verification
if: matrix.release_gates
run: make verify
- name: Build, validate, and install distribution
if: matrix.release_gates
run: make package-smoke
- name: Upload distributions
if: matrix.release_gates
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: dlhub-dist-${{ github.sha }}
path: dist/
if-no-files-found: error
retention-days: 7
- name: Tests
run: make test