From 908ed3c8c31741513b29eaa78d79df6481a458dc Mon Sep 17 00:00:00 2001 From: Saransh Chopra Date: Wed, 18 Sep 2024 11:41:33 +0100 Subject: [PATCH] gh-204: split examples job and run it only on code changes --- .github/workflows/examples.yml | 29 +++++++++++++++++++++++++++++ .github/workflows/test.yml | 13 ------------- 2 files changed, 29 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/examples.yml diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml new file mode 100644 index 00000000..0ce03ffa --- /dev/null +++ b/.github/workflows/examples.yml @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e6493ad7..6d628ffe 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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