From 4d1e6205ed9b0bbe13d0bf0921717fd726a5f35f Mon Sep 17 00:00:00 2001 From: Jacomo Corrieri Date: Sun, 5 Jul 2026 18:25:12 -0400 Subject: [PATCH 1/6] demo github actions workflow --- .github/workflows/github-actions.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/github-actions.yaml diff --git a/.github/workflows/github-actions.yaml b/.github/workflows/github-actions.yaml new file mode 100644 index 0000000..5c0dd0c --- /dev/null +++ b/.github/workflows/github-actions.yaml @@ -0,0 +1,19 @@ +name: GitHub Actions Demo +run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 +on: [push] +jobs: + Explore-GitHub-Actions: + runs-on: ubuntu-latest + steps: + - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" + - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v6 + - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." + - run: echo "🖥️ The workflow is now ready to test your code on the runner." + - name: List files in the repository + run: | + ls ${{ github.workspace }} + - run: echo "🍏 This job's status is ${{ job.status }}." + From 719516a47ba7b60753dd4e16c2425795dedecd08 Mon Sep 17 00:00:00 2001 From: Jacomo Corrieri Date: Sun, 5 Jul 2026 18:56:44 -0400 Subject: [PATCH 2/6] update workflow to include installation, linting, formatting, and testing w uv --- .github/workflows/github-actions.yaml | 57 ++++++++++++++++++++------- 1 file changed, 42 insertions(+), 15 deletions(-) diff --git a/.github/workflows/github-actions.yaml b/.github/workflows/github-actions.yaml index 5c0dd0c..67333bf 100644 --- a/.github/workflows/github-actions.yaml +++ b/.github/workflows/github-actions.yaml @@ -1,19 +1,46 @@ -name: GitHub Actions Demo -run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 -on: [push] +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: MoTorch Dev + +on: + push: + branches: [ dev ] + pull_request: + branches: [ dev ] + +permissions: + contents: read + jobs: - Explore-GitHub-Actions: + check: runs-on: ubuntu-latest + steps: - - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" - - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." - - name: Check out repository code - uses: actions/checkout@v6 - - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." - - run: echo "🖥️ The workflow is now ready to test your code on the runner." - - name: List files in the repository - run: | - ls ${{ github.workspace }} - - run: echo "🍏 This job's status is ${{ job.status }}." + - uses: actions/checkout@v7 + + - name: Set up Python # faster as it uses cached Python versions + uses: actions/setup-python@v6 + with: + python-version-file: ".python-version" + + - name: Install uv + uses: astral-sh/setup-uv@d31148d669074a8d0a63714ba94f3201e7020bc3 # v8.3.0 + with: + version: "0.11.7" + enable-cache: true + + - name: Install the project + run: uv sync --locked --all-extras --dev + + - name: Check formatting + run: uv run ruff format --check . + + - name: Lint + run: uv run ruff check . + + - name: Test + run: uv run pytest tests + - name: Build package + run: uv build From 6ef50f09ec5ecf110b407022490f562c0d47ebd2 Mon Sep 17 00:00:00 2001 From: Jacomo Corrieri Date: Sun, 5 Jul 2026 19:00:28 -0400 Subject: [PATCH 3/6] Update README; CI test --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 43309ec..eb6917f 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,13 @@ Run the test suite with: uv run pytest ``` +Run linting & formatting with `Ruff`: + +```bash +uv run ruff format --check . +uv run ruff check . +``` + ## References The implementation is inspired by the following references: From 358b1a8434734e2babd4446aadba0bd8e8d2a964 Mon Sep 17 00:00:00 2001 From: Jacomo Corrieri Date: Sun, 5 Jul 2026 19:07:14 -0400 Subject: [PATCH 4/6] update gh workflow --- .github/workflows/github-actions.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions.yaml b/.github/workflows/github-actions.yaml index 67333bf..537bb68 100644 --- a/.github/workflows/github-actions.yaml +++ b/.github/workflows/github-actions.yaml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@v7 - - name: Set up Python # faster as it uses cached Python versions + - name: Set up Python # faster as it uses cached Python version uses: actions/setup-python@v6 with: python-version-file: ".python-version" From 27022904269830f2352737633353d968a09f9b68 Mon Sep 17 00:00:00 2001 From: Jacomo Corrieri Date: Sun, 5 Jul 2026 19:08:35 -0400 Subject: [PATCH 5/6] rename yaml file --- .github/workflows/{github-actions.yaml => dev.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{github-actions.yaml => dev.yaml} (100%) diff --git a/.github/workflows/github-actions.yaml b/.github/workflows/dev.yaml similarity index 100% rename from .github/workflows/github-actions.yaml rename to .github/workflows/dev.yaml From 5ba76eb7a14939f924ac82b0f46c7ef9bc7a433e Mon Sep 17 00:00:00 2001 From: Jacomo Corrieri Date: Sun, 5 Jul 2026 20:26:39 -0400 Subject: [PATCH 6/6] change workflow -> main --- .github/workflows/dev.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev.yaml b/.github/workflows/dev.yaml index 537bb68..6ff1034 100644 --- a/.github/workflows/dev.yaml +++ b/.github/workflows/dev.yaml @@ -5,9 +5,9 @@ name: MoTorch Dev on: push: - branches: [ dev ] + branches: [ main ] pull_request: - branches: [ dev ] + branches: [ main ] permissions: contents: read