Repository navigation
103 lines (95 loc) · 3.12 KB
/
Copy pathci.yaml
File metadata and controls
103 lines (95 loc) · 3.12 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
name: CI
on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
PIP_DISABLE_PIP_VERSION_CHECK: "1"
PYTHONDONTWRITEBYTECODE: "1"
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out repository
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.0.2
- name: Set up Python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.2.0
with:
python-version: "3.11"
- name: Install Ruff
run: python -m pip install ruff==0.11.4
- name: Run high-confidence lint checks
run: ruff check src tests setup.py --select E4,E7,E9,F --ignore E731
unit-tests:
name: CPU unit tests (Python 3.9)
runs-on: ubuntu-latest
timeout-minutes: 30
env:
HF_HUB_OFFLINE: "1"
TRANSFORMERS_OFFLINE: "1"
WANDB_MODE: disabled
steps:
- name: Check out repository
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.0.2
- name: Set up Python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.2.0
with:
python-version: "3.9"
cache: pip
cache-dependency-path: |
requirements.txt
setup.py
- name: Install CPU-only PyTorch
run: >-
python -m pip install
--index-url https://download.pytorch.org/whl/cpu
torch==2.8.0+cpu
- name: Install LMFlow and test dependencies
run: python -m pip install -e ".[develop]"
- name: Run offline CPU tests
run: >-
python -m pytest -q --strict-markers
-m "not gpu and not slow and not online and not optional_backend"
package:
name: Build package
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out repository
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.0.2
- name: Set up Python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.2.0
with:
python-version: "3.11"
cache: pip
- name: Install build tools
run: python -m pip install build twine
- name: Build distributions
run: python -m build
- name: Validate distributions
run: python -m twine check dist/*
- name: Install wheel without runtime dependencies
run: python -m pip install --no-deps --force-reinstall dist/*.whl
- name: Verify installed package metadata
run: |
python - <<'PY'
from importlib.metadata import metadata, version
package_metadata = metadata("lmflow")
assert version("lmflow")
assert package_metadata["Requires-Python"] == ">=3.9"
PY
- name: Upload distributions
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: python-distributions
path: dist/
if-no-files-found: error