Skip to content

Commit cce21ee

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

File tree

3 files changed

+76
-0
lines changed

3 files changed

+76
-0
lines changed

.github/workflows/build.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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"]
21+
python: ["3.8", "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: Install torch with CUDA support
47+
run: python -m pip install torch --index-url https://download.pytorch.org/whl/cu121
48+
49+
- name: Install torchhull
50+
run: python -m pip install --editable ".[dev]"
51+
52+
- name: Run compilation
53+
run: nox --no-venv -s build
54+
55+
check_build:
56+
if: always()
57+
58+
needs:
59+
- build
60+
61+
name: "Check Build"
62+
runs-on: ubuntu-22.04
63+
64+
steps:
65+
- uses: re-actors/alls-green@release/v1
66+
with:
67+
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)