Skip to content

Commit 1b97fe6

Browse files
Enables testing for pull requests
1 parent b84cc26 commit 1b97fe6

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.github/workflows/build-and-test.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Build And Test
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
types: [synchronize, opened, reopened, ready_for_review]
8+
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
container:
14+
image: nvcr.io/nvidia/tritonserver:24.10-py3
15+
volumes:
16+
- ${{ github.workspace }}:/server
17+
# Mount /usr so we can free space
18+
- /usr:/host_usr
19+
env:
20+
AGENT_TOOLSDIRECTORY: "$AGENT_TOOLSDIRECTORY"
21+
22+
steps:
23+
- uses: actions/checkout@v3
24+
25+
- name: Free space
26+
run: |
27+
rm -rf \
28+
/host_usr/share/dotnet /host_usr/local/lib/android /opt/ghc \
29+
/host_usr/local/share/powershell /host_usr/share/swift /host_usr/local/.ghcup \
30+
/host_usr/lib/jvm
31+
rm -rf "$AGENT_TOOLSDIRECTORY"
32+
33+
- name: Install dependencies
34+
run: |
35+
apt update
36+
apt install -y --no-install-recommends clang-format-15 cmake libb64-dev rapidjson-dev libre2-dev libssl-dev
37+
wget -O /tmp/boost.tar.gz https://archives.boost.io/release/1.80.0/source/boost_1_80_0.tar.gz && (cd /tmp && tar xzf boost.tar.gz) && mv /tmp/boost_1_80_0/boost /usr/include/boost
38+
pip install pytest requests /opt/tritonserver/python/*.whl pydantic tritonclient[all]
39+
40+
- name: Build
41+
run: |
42+
mkdir -p /server/build
43+
cd /server/build
44+
cmake -DCMAKE_INSTALL_PREFIX:PATH=`pwd`/install ..
45+
make -j8
46+
47+
- name: Run tests with pytest
48+
run: |
49+
cd /server
50+
python3 -m pip install --force-reinstall build/triton-server/python/generic/wheel/dist/tritonfrontend-*.whl
51+
pytest qa/L0_python_api/ -v

0 commit comments

Comments
 (0)