Skip to content

Commit 3557adb

Browse files
committed
ci: trigger GPU tests with PR labels
1 parent 5502e94 commit 3557adb

3 files changed

Lines changed: 82 additions & 163 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -64,53 +64,3 @@ jobs:
6464

6565
- name: Test GPU infrastructure
6666
run: uv run pytest -q -m "not gpu"
67-
68-
gpu-test:
69-
if: github.event_name == 'push'
70-
needs: build-and-test
71-
concurrency:
72-
group: gpu-ci
73-
cancel-in-progress: false
74-
runs-on: ubuntu-24.04
75-
timeout-minutes: 45
76-
77-
steps:
78-
- uses: actions/checkout@v4
79-
80-
- name: Install LLVM ${{ env.LLVM_VERSION }} and MLIR
81-
run: |
82-
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
83-
sudo add-apt-repository -y "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-${LLVM_VERSION} main"
84-
sudo apt-get update
85-
sudo apt-get install -y \
86-
clang-${LLVM_VERSION} \
87-
llvm-${LLVM_VERSION}-dev \
88-
libmlir-${LLVM_VERSION}-dev \
89-
mlir-${LLVM_VERSION}-tools
90-
91-
- uses: astral-sh/setup-uv@v4
92-
93-
- name: Install Python dependencies
94-
run: uv sync
95-
96-
- name: Configure
97-
run: |
98-
cmake -B build \
99-
-DCMAKE_BUILD_TYPE=Release \
100-
-DCMAKE_C_COMPILER=clang-${LLVM_VERSION} \
101-
-DCMAKE_CXX_COMPILER=clang++-${LLVM_VERSION} \
102-
-DMLIR_DIR=/usr/lib/llvm-${LLVM_VERSION}/lib/cmake/mlir \
103-
-DLLVM_DIR=/usr/lib/llvm-${LLVM_VERSION}/lib/cmake/llvm
104-
105-
- name: Build
106-
run: cmake --build build
107-
108-
- name: Run GPU tests on Vast.ai
109-
env:
110-
VASTAI_API_KEY: ${{ secrets.VASTAI_API_KEY }}
111-
run: |
112-
if [ -z "$VASTAI_API_KEY" ]; then
113-
echo "VASTAI_API_KEY repository secret is not configured" >&2
114-
exit 1
115-
fi
116-
uv run pytest -v -m gpu

.github/workflows/gpu-pr.yml

Lines changed: 0 additions & 113 deletions
This file was deleted.

.github/workflows/gpu.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: GPU
2+
3+
on:
4+
pull_request:
5+
types: [labeled]
6+
workflow_run:
7+
workflows: [CI]
8+
types: [completed]
9+
branches: [canon]
10+
11+
permissions:
12+
contents: read
13+
issues: write
14+
15+
env:
16+
LLVM_VERSION: "20"
17+
18+
jobs:
19+
gpu-test:
20+
if: >-
21+
(github.event_name == 'pull_request' && github.event.label.name == 'gpu-test' &&
22+
github.actor == github.repository_owner && github.triggering_actor == github.repository_owner &&
23+
github.event.pull_request.head.repo.full_name == github.repository) ||
24+
(github.event_name == 'workflow_run' && github.event.workflow_run.event == 'push' &&
25+
github.event.workflow_run.conclusion == 'success')
26+
concurrency:
27+
group: gpu-ci
28+
cancel-in-progress: false
29+
runs-on: ubuntu-24.04
30+
timeout-minutes: 45
31+
32+
steps:
33+
- uses: actions/checkout@v4
34+
with:
35+
ref: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_sha || github.sha }}
36+
37+
- name: Install LLVM ${{ env.LLVM_VERSION }} and MLIR
38+
run: |
39+
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
40+
sudo add-apt-repository -y "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-${LLVM_VERSION} main"
41+
sudo apt-get update
42+
sudo apt-get install -y \
43+
clang-${LLVM_VERSION} \
44+
llvm-${LLVM_VERSION}-dev \
45+
libmlir-${LLVM_VERSION}-dev \
46+
mlir-${LLVM_VERSION}-tools
47+
48+
- uses: astral-sh/setup-uv@v4
49+
50+
- name: Install Python dependencies
51+
run: uv sync
52+
53+
- name: Configure
54+
run: |
55+
cmake -B build \
56+
-DCMAKE_BUILD_TYPE=Release \
57+
-DCMAKE_C_COMPILER=clang-${LLVM_VERSION} \
58+
-DCMAKE_CXX_COMPILER=clang++-${LLVM_VERSION} \
59+
-DMLIR_DIR=/usr/lib/llvm-${LLVM_VERSION}/lib/cmake/mlir \
60+
-DLLVM_DIR=/usr/lib/llvm-${LLVM_VERSION}/lib/cmake/llvm
61+
62+
- name: Build
63+
run: cmake --build build
64+
65+
- name: Run GPU tests on Vast.ai
66+
env:
67+
VASTAI_API_KEY: ${{ secrets.VASTAI_API_KEY }}
68+
run: |
69+
if [ -z "$VASTAI_API_KEY" ]; then
70+
echo "VASTAI_API_KEY repository secret is not configured" >&2
71+
exit 1
72+
fi
73+
uv run pytest -v -m gpu
74+
75+
- name: Remove GPU test trigger label
76+
if: always() && github.event_name == 'pull_request'
77+
env:
78+
GH_TOKEN: ${{ github.token }}
79+
PR_NUMBER: ${{ github.event.pull_request.number }}
80+
run: |
81+
gh api --method DELETE \
82+
"repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/labels/gpu-test"

0 commit comments

Comments
 (0)