Skip to content
Merged
39 changes: 39 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tested this yet? I'm not sure this package will build on the standard GitHub runners (in fact, I'm pretty sure it won't, since there are CUDA requirements like torch-geometric, but I could be wrong). We want to do this kind of testing (I have a similar file for sampleworks waiting in the wings) but we need our own runners first. Moody has this in the works, and it should be ready next week AFAIK.

@DorisMai DorisMai Mar 5, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build with the existing pyproject.toml actually ran fine? Technically the torch related packages can be installed with cpu kernels and the current tests don't seem to require gpu. But yes I am aware that the current workflow won't work for gpu explicit test. look forward to our own runner.


on:
# push:
# branches: [main]
# pull_request:
# branches: [main]
workflow_dispatch:
Comment on lines +4 to +8

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The push and pull_request triggers for the Build workflow are commented out, meaning this workflow is only triggered manually via workflow_dispatch. The PR description explicitly states the goal is to "force all pushes and PR on the main branch to pass the pytests." With the current configuration, the build/test step will never run automatically on pushes or pull requests. The trigger section should be uncommented to achieve the stated goal.

Copilot uses AI. Check for mistakes.

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.12]

# Skip CI if 'skip ci' is in the latest commit message (only relevant for push/pull_request triggers)
# if: "!contains(github.event.head_commit.message, 'skip ci')"
# Will add back on skipping for draft PRs too.
# if: |
# !contains(github.event.head_commit.message, 'skip ci') &&
# (github.event_name != 'pull_request' || !github.event.pull_request.draft)

steps:
- uses: actions/checkout@v6

- name: Setup UV and python version
uses: astral-sh/setup-uv@v7
with:
version: "0.10.6"
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: uv sync --group dev

- name: Run tests
env:
TEST_DATA_DIR: ${{ github.workspace }}/tests/test_files
run: uv run pytest tests/ --cov=src --cov-report=html --cov-report=term-missing --cov-fail-under=80
45 changes: 45 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Lint

on:
# pull_request:
# branches: [main]
workflow_dispatch:

jobs:
ruff:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.head_ref }}

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The github.head_ref context variable is only populated for pull_request events, not for push events. Since this workflow triggers on both push and pull_request (lines 4–7), when a push to main occurs, github.head_ref will be an empty string. Passing an empty string as the ref parameter to actions/checkout may cause unexpected behavior (checking out an empty ref or failing). Consider using a conditional such as ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} to handle both trigger types correctly.

Suggested change
ref: ${{ github.head_ref }}
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}

Copilot uses AI. Check for mistakes.
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install ruff
run: pip install ruff

- name: Auto-fix with ruff
run: |
ruff check --fix .
ruff format .

- name: Commit ruff fixes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Auto-commit ruff fixes [skip ci]"
commit_username: "Autoformatter"
commit_email: "actions@github.com"

ty:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6

- name: Setup UV and python version
uses: astral-sh/setup-uv@v7

- name: Run ty
run: uvx ty check src/
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.0
hooks:
# Run the linter.
- id: ruff-check
args: [--verbose, --fix]
# Run the formatter.
- id: ruff-format
args: [--verbose]

- repo: local
hooks:
- id: ty
name: ty check
entry: uv run ty check
language: system
types: [python]