Skip to content

Commit

Permalink
Add build jobs to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
stotko committed Nov 8, 2024
1 parent 48401de commit cce21ee
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Build

on:
push:
branches:
- main

pull_request:
types: [opened, reopened, synchronize]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
strategy:
fail-fast: false
matrix:
os: ["ubuntu-22.04", "windows-2022"]
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]

name: "${{ matrix.os }} / Python ${{ matrix.python }}"
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
docker-images: false
swap-storage: false

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: "pip"

- name: Install torch with CUDA support
run: python -m pip install torch --index-url https://download.pytorch.org/whl/cu121

- name: Install torchhull
run: python -m pip install --editable ".[dev]"

- name: Run compilation
run: nox --no-venv -s build

check_build:
if: always()

needs:
- build

name: "Check Build"
runs-on: ubuntu-22.04

steps:
- uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
<a href="https://github.com/vc-bonn/torchhull/blob/main/LICENSE">
<img alt="GitHub License" src="https://img.shields.io/badge/License-BSD--3--Clause-green.svg"/>
</a>
<a href="https://github.com/vc-bonn/torchhull/actions/workflows/build.yml">
<img alt="Build" src="https://github.com/vc-bonn/torchhull/actions/workflows/build.yml/badge.svg">
</a>
<a href="https://github.com/vc-bonn/torchhull/actions/workflows/lint.yml">
<img alt="Lint" src="https://github.com/vc-bonn/torchhull/actions/workflows/lint.yml/badge.svg">
</a>
Expand Down
6 changes: 6 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ def lint(session: nox.Session) -> None:
raise nox.command.CommandFailed


@nox.session
def build(session: nox.Session) -> None:
"""Run the compilation (REQUIRES '--no-venv')."""
session.run("python", "-c", "import torch; import torchhull", external=True)


@nox.session
def benchmarks(session: nox.Session) -> None:
"""Runs the benchmarks."""
Expand Down

0 comments on commit cce21ee

Please sign in to comment.