Skip to content

Commit

Permalink
gh-204: split examples job and run it only on code changes (#237)
Browse files Browse the repository at this point in the history
Makes example tests a standalone job that executes only if something is
changed in `glass/`.

Closes: #204
  • Loading branch information
Saransh-cpp committed Sep 18, 2024
1 parent f7cedc9 commit 7c1d9d2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 13 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test examples

on:
push:
paths:
- "glass/**"
pull_request:
paths:
- "glass/**"

concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
test-examples:
name: Test examples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: pip
- run: pipx run --spec '.[examples]' jupyter execute examples/**/*.ipynb
13 changes: 0 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,3 @@ jobs:
sudo apt-get update
sudo apt-get install pandoc
- run: pipx run --spec '.[docs]' sphinx-build -W -b html docs _build/html

examples:
name: Examples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: pip
- run: pipx run --spec '.[examples]' jupyter execute examples/**/*.ipynb

0 comments on commit 7c1d9d2

Please sign in to comment.