Skip to content

Commit e916625

Browse files
committed
Add build jobs to CI
1 parent 48401de commit e916625

File tree

3 files changed

+96
-0
lines changed

3 files changed

+96
-0
lines changed

.github/workflows/build.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
pull_request:
9+
types: [opened, reopened, synchronize]
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
build:
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
os: ["ubuntu-22.04"] # "windows-2022" # Disabled until solution/workaround for NVTX is present
21+
python: ["3.9", "3.10", "3.11", "3.12"]
22+
23+
name: "${{ matrix.os }} / Python ${{ matrix.python }}"
24+
runs-on: ${{ matrix.os }}
25+
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- name: Free Disk Space (Ubuntu)
30+
uses: jlumbroso/free-disk-space@main
31+
with:
32+
tool-cache: false
33+
android: true
34+
dotnet: true
35+
haskell: true
36+
large-packages: false
37+
docker-images: false
38+
swap-storage: false
39+
40+
- name: Set up Python ${{ matrix.python }}
41+
uses: actions/setup-python@v5
42+
with:
43+
python-version: ${{ matrix.python }}
44+
cache: "pip"
45+
46+
- name: Set up CUDA toolkit (Ubuntu)
47+
if: runner.os == 'Linux'
48+
uses: Jimver/cuda-toolkit@master
49+
with:
50+
cuda: "12.1.0"
51+
method: "network"
52+
sub-packages: '["toolkit"]'
53+
54+
- name: Set up CUDA toolkit (Windows)
55+
if: runner.os == 'Windows'
56+
uses: Jimver/cuda-toolkit@master
57+
with:
58+
cuda: "12.4.0"
59+
method: "network"
60+
61+
- name: Install torch with CUDA support (Ubuntu)
62+
if: runner.os == 'Linux'
63+
run: python -m pip install torch --index-url https://download.pytorch.org/whl/cu121
64+
65+
- name: Install torch with CUDA support (Windows)
66+
if: runner.os == 'Windows'
67+
run: python -m pip install torch --index-url https://download.pytorch.org/whl/cu124
68+
69+
- name: Install torchhull
70+
run: python -m pip install --editable ".[dev]"
71+
72+
- name: Run compilation
73+
run: nox --no-venv -s build
74+
75+
check_build:
76+
if: always()
77+
78+
needs:
79+
- build
80+
81+
name: "Check Build"
82+
runs-on: ubuntu-22.04
83+
84+
steps:
85+
- uses: re-actors/alls-green@release/v1
86+
with:
87+
jobs: ${{ toJSON(needs) }}

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
<a href="https://github.com/vc-bonn/torchhull/blob/main/LICENSE">
1616
<img alt="GitHub License" src="https://img.shields.io/badge/License-BSD--3--Clause-green.svg"/>
1717
</a>
18+
<a href="https://github.com/vc-bonn/torchhull/actions/workflows/build.yml">
19+
<img alt="Build" src="https://github.com/vc-bonn/torchhull/actions/workflows/build.yml/badge.svg">
20+
</a>
1821
<a href="https://github.com/vc-bonn/torchhull/actions/workflows/lint.yml">
1922
<img alt="Lint" src="https://github.com/vc-bonn/torchhull/actions/workflows/lint.yml/badge.svg">
2023
</a>

noxfile.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,12 @@ def lint(session: nox.Session) -> None:
170170
raise nox.command.CommandFailed
171171

172172

173+
@nox.session
174+
def build(session: nox.Session) -> None:
175+
"""Run the compilation (REQUIRES '--no-venv')."""
176+
session.run("python", "-c", "import torch; import torchhull", external=True)
177+
178+
173179
@nox.session
174180
def benchmarks(session: nox.Session) -> None:
175181
"""Runs the benchmarks."""

0 commit comments

Comments
 (0)