Tutorial tests #111
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tutorial tests | |
| on: | |
| # Trigger the workflow on push | |
| push: | |
| # Selected branches | |
| branches: [master, main, develop] | |
| # Trigger the workflow on pull request | |
| pull_request: | |
| branches: ['**'] | |
| # Trigger the workflow on workflow_call (to be called from other workflows) | |
| # Needed, as standard schedule triggers the master branch only, but we want | |
| # to run this workflow on develop branch. | |
| workflow_call: | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| # Allow only one concurrent workflow, skipping runs queued between the run | |
| # in-progress and latest queued. And cancel in-progress runs. | |
| concurrency: | |
| group: | |
| ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| # Set the environment variables to be used in all jobs defined in this workflow | |
| env: | |
| CI_BRANCH: ${{ github.head_ref || github.ref_name }} | |
| jobs: | |
| # Job 1: Test tutorials as scripts and notebooks on multiple OS | |
| tutorial-tests: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Set up pixi | |
| uses: prefix-dev/[email protected] | |
| with: | |
| environments: default | |
| activate-environment: default | |
| run-install: true | |
| frozen: true | |
| cache: false | |
| post-cleanup: false | |
| - name: Install and setup development dependencies | |
| shell: bash | |
| run: pixi run dev | |
| - name: Test tutorials as python scripts | |
| shell: bash | |
| run: pixi run script-tests | |
| - name: Convert tutorial scripts to notebooks | |
| shell: bash | |
| run: pixi run notebook-prepare | |
| - name: Test tutorials as notebooks | |
| shell: bash | |
| run: pixi run notebook-tests | |
| # Job 2: Trigger dashboard build | |
| dashboard-build-trigger: | |
| needs: tutorial-tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check-out repository | |
| uses: actions/checkout@v5 | |
| - name: Trigger dashboard build | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| await github.rest.actions.createWorkflowDispatch({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| workflow_id: "dashboard.yaml", | |
| ref: "${{ env.CI_BRANCH }}" | |
| }); |