-
Notifications
You must be signed in to change notification settings - Fork 87
120 lines (101 loc) · 3.1 KB
/
pr-format.yml
File metadata and controls
120 lines (101 loc) · 3.1 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
on:
pull_request:
branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
env:
TMPDIR: /mnt/tmp
PRE_COMMIT_HOME: /mnt/pre-commit-cache
steps:
- uses: actions/checkout@v4
- name: Prepare temp/cache directories on /mnt
run: |
sudo mkdir -p "$TMPDIR" "$PRE_COMMIT_HOME"
sudo chown "$USER":"$USER" "$TMPDIR" "$PRE_COMMIT_HOME"
df -h /
df -h /mnt
- uses: astral-sh/setup-uv@v6
with:
python-version: "3.11"
- name: Create lint environment
run: uv venv --python 3.11
- name: Install lint dependencies
run: uv pip install --python .venv/bin/python pre-commit black isort
- name: Run lint
run: .venv/bin/pre-commit run --all-files
unit_tests:
needs: lint
runs-on: ubuntu-latest
strategy:
matrix:
include:
- test-suite: analysis
install-target: .
- test-suite: evaluation
install-target: ".[pyserini]"
needs-java: true
- test-suite: rerank
install-target: ".[cloud,vllm]"
env:
TMPDIR: /mnt/tmp
steps:
- uses: actions/checkout@v4
- name: Prepare temp directory on /mnt
run: |
sudo mkdir -p "$TMPDIR"
sudo chown "$USER":"$USER" "$TMPDIR"
df -h /
df -h /mnt
- uses: actions/setup-java@v3
if: ${{ matrix.needs-java }}
with:
distribution: "temurin"
java-version: "21"
- uses: astral-sh/setup-uv@v6
with:
python-version: "3.11"
- name: Create test environment
run: uv venv --python 3.11
- name: Install test environment
run: uv pip install --python .venv/bin/python -e "${{ matrix.install-target }}"
- name: Run tests
run: .venv/bin/python -m unittest discover -s "test/${{ matrix.test-suite }}"
cli_smoke:
needs: lint
runs-on: ubuntu-latest
env:
TMPDIR: /mnt/tmp
steps:
- uses: actions/checkout@v4
- name: Prepare temp directory on /mnt
run: |
sudo mkdir -p "$TMPDIR"
sudo chown "$USER":"$USER" "$TMPDIR"
df -h /
df -h /mnt
- uses: astral-sh/setup-uv@v6
with:
python-version: "3.11"
- name: Create CLI environment
run: uv venv --python 3.11
- name: Install CLI smoke environment
run: |
uv pip install --python .venv/bin/python -e .
uv pip install --python .venv/bin/python fastapi uvicorn "fastmcp>=2.0,<3"
echo "$PWD/.venv/bin" >> "$GITHUB_PATH"
- name: Run CLI smoke tests
run: |
.venv/bin/python -m unittest \
test.test_cli_packaging \
test.test_cli_scaffolding \
test.test_cli_rerank_command \
test.test_cli_validation \
test.test_cli_prompt \
test.test_cli_view \
test.test_cli_introspection \
test.test_cli_utilities \
test.test_cli_http \
test.test_cli_mcp \
test.test_cli_legacy_wrappers