From 29b74f2730960f2f6044afe6ac4e6f85763bf07a Mon Sep 17 00:00:00 2001 From: Vivus Ignis Date: Fri, 14 Nov 2025 11:48:52 +0100 Subject: [PATCH 01/12] using only poetry cache --- .github/actions/setup/action.yml | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 50b90361..52f5bfd0 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -16,37 +16,18 @@ outputs: python_version: description: Python version to setup value: ${{ inputs.python_version }} - package_tool: - description: "Detected Python cache strategy." - value: ${{ steps.env-check.outputs.package_tool }} runs: using: composite steps: - - name: Evaluate Python environment - id: env-check - shell: bash - run: | - # Determine cache type based on available lockfile - if [ -f poetry.lock ]; then - echo "package_tool=poetry" >> $GITHUB_OUTPUT - elif [ -f requirements.txt ]; then - echo "package_tool=pip" >> $GITHUB_OUTPUT - else - # no lockfile present: create one and use pip caching - echo "gardenlinux @ git+https://github.com/gardenlinux/python-gardenlinux-lib.git@${{ inputs.version }}" | tee -a requirements.txt - echo "package_tool=pip" >> $GITHUB_OUTPUT - fi - - name: Install Poetry - if: steps.env-check.outputs.package_tool == 'poetry' uses: snok/install-poetry@v1 - name: Set up Python ${{ inputs.python_version }} uses: actions/setup-python@v5 with: python-version: ${{ inputs.python_version }} - cache: ${{ steps.env-check.outputs.package_tool }} + cache: poetry - name: Install GardenLinux Python library shell: bash From 3c5d4028fee3c6dec35396d865924dfa33b30199 Mon Sep 17 00:00:00 2001 From: Vivus Ignis Date: Fri, 14 Nov 2025 14:44:39 +0100 Subject: [PATCH 02/12] installing with pip from GH release artifacts --- .github/actions/setup/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 52f5bfd0..be69d7ae 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -27,9 +27,9 @@ runs: uses: actions/setup-python@v5 with: python-version: ${{ inputs.python_version }} - cache: poetry + cache: pip - name: Install GardenLinux Python library shell: bash run: | - pip install git+https://github.com/gardenlinux/python-gardenlinux-lib.git@${{ inputs.version }} + pip install https://github.com/gardenlinux/python-gardenlinux-lib/releases/download/${{ inputs.version }}/gardenlinux-${{ inputs.version }}-py3-none-any.whl From 256ccead20f431c5524fe1554bac72493829863f Mon Sep 17 00:00:00 2001 From: Vivus Ignis Date: Fri, 14 Nov 2025 14:58:35 +0100 Subject: [PATCH 03/12] no need for poetry here --- .github/actions/setup/action.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index be69d7ae..3a1bce5f 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -20,9 +20,6 @@ outputs: runs: using: composite steps: - - name: Install Poetry - uses: snok/install-poetry@v1 - - name: Set up Python ${{ inputs.python_version }} uses: actions/setup-python@v5 with: From cf1e62596e372dbd531d263178a0c19d54411169 Mon Sep 17 00:00:00 2001 From: Vivus Ignis Date: Fri, 14 Nov 2025 15:00:54 +0100 Subject: [PATCH 04/12] switched flavors_matrix to the test branch as well --- .github/actions/flavors_parse/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/flavors_parse/action.yml b/.github/actions/flavors_parse/action.yml index b0d2a9d7..6a8ece2e 100644 --- a/.github/actions/flavors_parse/action.yml +++ b/.github/actions/flavors_parse/action.yml @@ -13,7 +13,7 @@ outputs: runs: using: composite steps: - - uses: gardenlinux/python-gardenlinux-lib/.github/actions/setup@0.10.5 + - uses: gardenlinux/python-gardenlinux-lib/.github/actions/setup@255-improve-caching-used-in-gh-actions - id: matrix shell: bash run: | From ccc5e9dd8fcd786294e8eb63a6ce10ff63f8fd90 Mon Sep 17 00:00:00 2001 From: Vivus Ignis Date: Fri, 14 Nov 2025 15:04:07 +0100 Subject: [PATCH 05/12] no cache --- .github/actions/setup/action.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 3a1bce5f..6644a9c1 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -24,7 +24,6 @@ runs: uses: actions/setup-python@v5 with: python-version: ${{ inputs.python_version }} - cache: pip - name: Install GardenLinux Python library shell: bash From cf56ea16153dbd798b3a86edd8de487b67938801 Mon Sep 17 00:00:00 2001 From: Vivus Ignis Date: Fri, 14 Nov 2025 15:36:19 +0100 Subject: [PATCH 06/12] caching --- .github/actions/setup/action.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 6644a9c1..97b1dc7b 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -25,7 +25,25 @@ runs: with: python-version: ${{ inputs.python_version }} + - name: Restore python cache + id: restore-python-cache + uses: actions/cache/restore@v4 + with: + path: | + ~/.local/lib/python${{ inputs.python_version }}/site-packages + key: pygl-${{ inputs.python_version }}-${{ inputs.version }} + - name: Install GardenLinux Python library shell: bash run: | - pip install https://github.com/gardenlinux/python-gardenlinux-lib/releases/download/${{ inputs.version }}/gardenlinux-${{ inputs.version }}-py3-none-any.whl + pip install --user \ + https://github.com/gardenlinux/python-gardenlinux-lib/releases/download/${{ inputs.version }}/gardenlinux-${{ inputs.version }}-py3-none-any.whl + ls -l $HOME/.local/lib/python${{ inputs.python_version }}/site-packages + + - name: Save python cache + id: save-python-cache + uses: actions/cache/save@v4 + with: + path: | + ~/.local/lib/python${{ inputs.python_version }}/site-packages + key: pygl-${{ inputs.python_version }}-${{ inputs.version }} From 7a2c9f1218ef62548576a923688266883e7be8f7 Mon Sep 17 00:00:00 2001 From: Vivus Ignis Date: Fri, 14 Nov 2025 15:52:38 +0100 Subject: [PATCH 07/12] better descriptions; debug step --- .github/actions/setup/action.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 97b1dc7b..3c60327d 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -1,9 +1,9 @@ -name: python_lib -description: Installs the given GardenLinux Python library +name: pygl_setup +description: Installs GardenLinux Python library inputs: version: - description: GardenLinux Python library version + description: GardenLinux Python library version to install default: "0.10.5" python_version: description: Python version to setup @@ -25,7 +25,7 @@ runs: with: python-version: ${{ inputs.python_version }} - - name: Restore python cache + - name: Restore python site-packages from cache id: restore-python-cache uses: actions/cache/restore@v4 with: @@ -34,13 +34,16 @@ runs: key: pygl-${{ inputs.python_version }}-${{ inputs.version }} - name: Install GardenLinux Python library - shell: bash run: | pip install --user \ https://github.com/gardenlinux/python-gardenlinux-lib/releases/download/${{ inputs.version }}/gardenlinux-${{ inputs.version }}-py3-none-any.whl - ls -l $HOME/.local/lib/python${{ inputs.python_version }}/site-packages - - name: Save python cache + - name: Debug + run: | + ls -l ~/.local/bin + echo $PATH + + - name: Cache python site-packages id: save-python-cache uses: actions/cache/save@v4 with: From 27798b81d75fcf098894fff8d4067e5b640e39b0 Mon Sep 17 00:00:00 2001 From: Vivus Ignis Date: Fri, 14 Nov 2025 15:53:47 +0100 Subject: [PATCH 08/12] added missing shell call --- .github/actions/setup/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 3c60327d..7f49405d 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -34,11 +34,13 @@ runs: key: pygl-${{ inputs.python_version }}-${{ inputs.version }} - name: Install GardenLinux Python library + shell: bash run: | pip install --user \ https://github.com/gardenlinux/python-gardenlinux-lib/releases/download/${{ inputs.version }}/gardenlinux-${{ inputs.version }}-py3-none-any.whl - name: Debug + shell: bash run: | ls -l ~/.local/bin echo $PATH From 6e2cac466fa830f7fc75102e7997eafecbdf6b78 Mon Sep 17 00:00:00 2001 From: Vivus Ignis Date: Fri, 14 Nov 2025 16:03:26 +0100 Subject: [PATCH 09/12] temporary disabling cache --- .github/actions/setup/action.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 7f49405d..1f0ad613 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -25,13 +25,13 @@ runs: with: python-version: ${{ inputs.python_version }} - - name: Restore python site-packages from cache - id: restore-python-cache - uses: actions/cache/restore@v4 - with: - path: | - ~/.local/lib/python${{ inputs.python_version }}/site-packages - key: pygl-${{ inputs.python_version }}-${{ inputs.version }} + # - name: Restore python site-packages from cache + # id: restore-python-cache + # uses: actions/cache/restore@v4 + # with: + # path: | + # ~/.local/lib/python${{ inputs.python_version }}/site-packages + # key: pygl-${{ inputs.python_version }}-${{ inputs.version }} - name: Install GardenLinux Python library shell: bash @@ -45,10 +45,10 @@ runs: ls -l ~/.local/bin echo $PATH - - name: Cache python site-packages - id: save-python-cache - uses: actions/cache/save@v4 - with: - path: | - ~/.local/lib/python${{ inputs.python_version }}/site-packages - key: pygl-${{ inputs.python_version }}-${{ inputs.version }} + # - name: Cache python site-packages + # id: save-python-cache + # uses: actions/cache/save@v4 + # with: + # path: | + # ~/.local/lib/python${{ inputs.python_version }}/site-packages + # key: pygl-${{ inputs.python_version }}-${{ inputs.version }} From 2bd16f0f7ff3009993a5aca71d3fd9164bfd426d Mon Sep 17 00:00:00 2001 From: Vivus Ignis Date: Fri, 14 Nov 2025 16:08:42 +0100 Subject: [PATCH 10/12] improved caching --- .github/actions/setup/action.yml | 36 ++++++++++++++------------------ 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 1f0ad613..4606f3d8 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -25,13 +25,14 @@ runs: with: python-version: ${{ inputs.python_version }} - # - name: Restore python site-packages from cache - # id: restore-python-cache - # uses: actions/cache/restore@v4 - # with: - # path: | - # ~/.local/lib/python${{ inputs.python_version }}/site-packages - # key: pygl-${{ inputs.python_version }}-${{ inputs.version }} + - name: Restore python site-packages from cache + id: restore-python-cache + uses: actions/cache/restore@v4 + with: + path: | + ~/.local/lib/python${{ inputs.python_version }}/site-packages + ~/.local/bin + key: pygl-${{ runner.arch }}-${{ inputs.python_version }}-${{ inputs.version }} - name: Install GardenLinux Python library shell: bash @@ -39,16 +40,11 @@ runs: pip install --user \ https://github.com/gardenlinux/python-gardenlinux-lib/releases/download/${{ inputs.version }}/gardenlinux-${{ inputs.version }}-py3-none-any.whl - - name: Debug - shell: bash - run: | - ls -l ~/.local/bin - echo $PATH - - # - name: Cache python site-packages - # id: save-python-cache - # uses: actions/cache/save@v4 - # with: - # path: | - # ~/.local/lib/python${{ inputs.python_version }}/site-packages - # key: pygl-${{ inputs.python_version }}-${{ inputs.version }} + - name: Cache python site-packages + id: save-python-cache + uses: actions/cache/save@v4 + with: + path: | + ~/.local/lib/python${{ inputs.python_version }}/site-packages + ~/.local/bin + key: pygl-${{ runner.arch }}-${{ inputs.python_version }}-${{ inputs.version }} From fa12ebb53957d8e6a3bea47892b7aa042ff1bacd Mon Sep 17 00:00:00 2001 From: Vivus Ignis Date: Fri, 14 Nov 2025 16:18:23 +0100 Subject: [PATCH 11/12] dev_setup action --- .github/workflows/bandit.yml | 2 +- .github/workflows/black.yml | 2 +- .github/workflows/build.yml | 2 +- .github/workflows/docs.yml | 2 +- .github/workflows/pytests.yml | 5 +---- 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/bandit.yml b/.github/workflows/bandit.yml index d70c8c17..2aefad3e 100644 --- a/.github/workflows/bandit.yml +++ b/.github/workflows/bandit.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - - uses: gardenlinux/python-gardenlinux-lib/.github/actions/setup@main + - uses: gardenlinux/python-gardenlinux-lib/.github/actions/dev_setup@255-improve-caching-used-in-gh-actions - name: Simple bandit security checks run: make security - name: Show Report in Action Output diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index 19efe917..bae89407 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -7,5 +7,5 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - - uses: gardenlinux/python-gardenlinux-lib/.github/actions/setup@main + - uses: gardenlinux/python-gardenlinux-lib/.github/actions/dev_setup@255-improve-caching-used-in-gh-actions - run: make lint diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 11bd0b73..d98c21f1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,6 +17,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - - uses: gardenlinux/python-gardenlinux-lib/.github/actions/setup@main + - uses: gardenlinux/python-gardenlinux-lib/.github/actions/dev_setup@255-improve-caching-used-in-gh-actions - name: Simple poetry build no package run: make build diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 6fff3074..4c91cc6a 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - - uses: gardenlinux/python-gardenlinux-lib/.github/actions/setup@main + - uses: gardenlinux/python-gardenlinux-lib/.github/actions/dev_setup@255-improve-caching-used-in-gh-actions - run: make docs - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v4 diff --git a/.github/workflows/pytests.yml b/.github/workflows/pytests.yml index 95371983..d93d781b 100644 --- a/.github/workflows/pytests.yml +++ b/.github/workflows/pytests.yml @@ -20,10 +20,7 @@ jobs: with: fetch-depth: 2 - - name: Setup Gardenlinux - uses: ./.github/actions/setup - with: - python_version: ${{ matrix.python_version }} + - uses: gardenlinux/python-gardenlinux-lib/.github/actions/dev_setup@255-improve-caching-used-in-gh-actions - name: Install dependencies run: poetry install --with dev From c5dd427e2a5b61e06fc8f70a42153e41794f6eb2 Mon Sep 17 00:00:00 2001 From: Vivus Ignis Date: Fri, 14 Nov 2025 16:21:49 +0100 Subject: [PATCH 12/12] dev_setup action --- .github/actions/dev_setup/action.yml | 36 ++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/actions/dev_setup/action.yml diff --git a/.github/actions/dev_setup/action.yml b/.github/actions/dev_setup/action.yml new file mode 100644 index 00000000..75ba882d --- /dev/null +++ b/.github/actions/dev_setup/action.yml @@ -0,0 +1,36 @@ +name: pygl_dev_setup +description: Installs GardenLinux Python library dev packages + +inputs: + version: + description: GardenLinux Python library version to install + default: "0.10.5" + python_version: + description: Python version to setup + default: "3.14" + +outputs: + version: + description: GardenLinux Python library version + value: ${{ inputs.version }} + python_version: + description: Python version to setup + value: ${{ inputs.python_version }} + +runs: + using: composite + steps: + - name: Set up Python ${{ inputs.python_version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ inputs.python_version }} + + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + version: 2.2.1 + + - name: Install GardenLinux Python library + shell: bash + run: | + poetry install --with=dev