Skip to content

Add CI validation for Google Colab tutorial support #2

@AndrewSazonov

Description

@AndrewSazonov

Currently, we do not have a dedicated CI step to verify that tutorials run correctly in Google Colab. Since Colab support is important for workshops and new users, we should explore adding an automated test step (possibly using the official Colab Docker image) to ensure tutorials execute successfully in a Colab-like environment.

Note that setting up and maintaining the local runner environment will be necessary.

Based on:
https://github.com/orgs/easyscience/discussions/24#discussioncomment-12488172

Here is a draft implementation of tutorial-tests-colab.yml:

name: Tutorial tests (Colab)

on:
  workflow_dispatch:

concurrency:
  group:
    ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  cancel-in-progress: true

jobs:
  tutorial-tests-colab:
    runs-on: ubuntu-latest

    container:
      image: europe-docker.pkg.dev/colab-images/public/runtime:latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v5

      - name: Set up pixi
        uses: ./.github/actions/setup-pixi
        with:
          environments: ''
          activate-environment: ''
          run-install: false
          frozen: false

      - name: Init pixi project
        run: pixi init

      - name: Add Python from Conda
        run: pixi add "python=3.13"

      - name: Add easydiffraction and its dev deps from PyPI
        run: pixi add --pypi "easydiffraction[all]"

      - name: Check if Jupyter Notebooks run without errors
        run: >
          python -m pytest --nbmake docs/docs/tutorials/ --nbmake-timeout=600
          --color=yes -n auto -v

Metadata

Metadata

Assignees

No one assigned

    Labels

    [scope] ⚠️ label neededAutomatically added to issues and PRs without a [scope] label

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions