From 04016373aed02dc23ac0cd6b72518a0bb91f9b14 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Thu, 16 Feb 2023 12:53:18 +0100 Subject: [PATCH 1/2] Prevent execution of spurious clean-up step, which then crashes. The clean-up step for setting up Python and pip assumes that you do at least something with those programs -- and so that cache folders have been made, that need to be cleaned up. If nothing happens, the clean-up step then crashes on the non-existant cache folder. --- .github/workflows/printer-linter-format.yml | 1 + .github/workflows/printer-linter-pr-diagnose.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/printer-linter-format.yml b/.github/workflows/printer-linter-format.yml index e5e1b5b1d6..7562a5055c 100644 --- a/.github/workflows/printer-linter-format.yml +++ b/.github/workflows/printer-linter-format.yml @@ -19,6 +19,7 @@ jobs: uses: actions/checkout@v3 - name: Setup Python and pip + if: env.GIT_DIFF && !env.MATCHED_FILES # If nothing happens with python and/or pip after, the clean-up crashes. uses: actions/setup-python@v4 with: python-version: 3.11.x diff --git a/.github/workflows/printer-linter-pr-diagnose.yml b/.github/workflows/printer-linter-pr-diagnose.yml index 0dac8ba7e7..0c55a93e2a 100644 --- a/.github/workflows/printer-linter-pr-diagnose.yml +++ b/.github/workflows/printer-linter-pr-diagnose.yml @@ -17,6 +17,7 @@ jobs: fetch-depth: 2 - name: Setup Python and pip + if: env.GIT_DIFF && !env.MATCHED_FILES # If nothing happens with python and/or pip after, the clean-up crashes. uses: actions/setup-python@v4 with: python-version: 3.11.x From a1c01193daa5e8b76ea9ba93bdd346d572aecbdb Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Thu, 16 Feb 2023 14:50:31 +0100 Subject: [PATCH 2/2] Move check so we can see if we even need python/pip. Otherwise those if checks placed in the last commit won't even do anything if there _is_ a change in the printer definitions. --- .github/workflows/printer-linter-format.yml | 12 ++++++------ .github/workflows/printer-linter-pr-diagnose.yml | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/printer-linter-format.yml b/.github/workflows/printer-linter-format.yml index 7562a5055c..8e65a481c4 100644 --- a/.github/workflows/printer-linter-format.yml +++ b/.github/workflows/printer-linter-format.yml @@ -18,6 +18,12 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - uses: technote-space/get-diff-action@v6 + with: + PATTERNS: | + resources/+(definitions|extruders)/*.def.json + resources/+(intent|quality|variants)/**/*.inst.cfg + - name: Setup Python and pip if: env.GIT_DIFF && !env.MATCHED_FILES # If nothing happens with python and/or pip after, the clean-up crashes. uses: actions/setup-python@v4 @@ -26,12 +32,6 @@ jobs: cache: 'pip' cache-dependency-path: .github/workflows/requirements-printer-linter.txt - - uses: technote-space/get-diff-action@v6 - with: - PATTERNS: | - resources/+(definitions|extruders)/*.def.json - resources/+(intent|quality|variants)/**/*.inst.cfg - - name: Install Python requirements for runner if: env.GIT_DIFF && !env.MATCHED_FILES run: pip install -r .github/workflows/requirements-printer-linter.txt diff --git a/.github/workflows/printer-linter-pr-diagnose.yml b/.github/workflows/printer-linter-pr-diagnose.yml index 0c55a93e2a..57c3732d81 100644 --- a/.github/workflows/printer-linter-pr-diagnose.yml +++ b/.github/workflows/printer-linter-pr-diagnose.yml @@ -16,6 +16,12 @@ jobs: with: fetch-depth: 2 + - uses: technote-space/get-diff-action@v6 + with: + PATTERNS: | + resources/+(extruders|definitions)/*.def.json + resources/+(intent|quality|variants)/**/*.inst.cfg + - name: Setup Python and pip if: env.GIT_DIFF && !env.MATCHED_FILES # If nothing happens with python and/or pip after, the clean-up crashes. uses: actions/setup-python@v4 @@ -24,12 +30,6 @@ jobs: cache: "pip" cache-dependency-path: .github/workflows/requirements-printer-linter.txt - - uses: technote-space/get-diff-action@v6 - with: - PATTERNS: | - resources/+(extruders|definitions)/*.def.json - resources/+(intent|quality|variants)/**/*.inst.cfg - - name: Install Python requirements for runner if: env.GIT_DIFF && !env.MATCHED_FILES run: pip install -r .github/workflows/requirements-printer-linter.txt