From 5125fbfb006f1c0d190e68b87da34bb31cd95c92 Mon Sep 17 00:00:00 2001 From: Frank Harkins Date: Mon, 11 Dec 2023 12:40:16 +0000 Subject: [PATCH] Try improving test efficiency --- .github/workflows/notebook-test.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/notebook-test.yml b/.github/workflows/notebook-test.yml index 0067f71630..1adde3c3af 100644 --- a/.github/workflows/notebook-test.yml +++ b/.github/workflows/notebook-test.yml @@ -27,9 +27,25 @@ jobs: with: python-version: "3.11" + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v40 + + - name: List all changed files + run: | + for file in ${{ steps.changed-files.outputs.all_changed_files }}; do + echo "$file was changed" + done + - name: Install LaTeX dependencies run: | - sudo apt-get install texlive-pictures texlive-latex-extra poppler-utils + NEEDS_LATEX="docs/build/circuit-visualization.ipynb" + for FILE in $NEEDS_LATEX; do + if [ ${{ steps.changed-files.outputs.all_changed_files }} =~ $FILE ]; then + sudo apt-get install texlive-pictures texlive-latex-extra poppler-utils + break + fi + done - name: Install Qiskit IBM Runtime to save account # To save account; this is re-installed during the "Run tox" step @@ -52,3 +68,4 @@ jobs: with: python-version: "3.11" tox-envs: "py311" + tox-posargs: ${{ steps.changed-files.outputs.all_changed_files }}