Repository: deephaven/deephaven-plugins (language: python)

Issue:
Clean up gh actions deprecations
We use deprecated versions for many gh actions, many due to [forced running on node 20](https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/)

can check any recent run, but for example https://github.com/deephaven/deephaven-plugins/actions/runs/11580934959


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/build-python-package.yml b/.github/workflows/build-python-package.yml
index de4d245ca..c4abbcb26 100644
--- a/.github/workflows/build-python-package.yml
+++ b/.github/workflows/build-python-package.yml
@@ -36,7 +36,7 @@ jobs:
         run: npm run build -- --scope "@deephaven/js-plugin-${{ inputs.package }}"
 
       - name: Set up Python
-        uses: actions/setup-python@v4
+        uses: actions/setup-python@v5
         with:
           python-version: '3.x'
 
@@ -47,7 +47,7 @@ jobs:
         run: python -m build --wheel --sdist plugins/${{ inputs.package }}
 
       - name: Upload dist
-        uses: actions/upload-artifact@v3
+        uses: actions/upload-artifact@v4
         with:
           name: dist-${{ inputs.package }}
           path: plugins/${{ inputs.package }}/dist/
diff --git a/.github/workflows/make-docs.yml b/.github/workflows/make-docs.yml
index 3bfd5303e..82d4efd61 100644
--- a/.github/workflows/make-docs.yml
+++ b/.github/workflows/make-docs.yml
@@ -27,7 +27,7 @@ jobs:
 
         # assume that the dist artifact is already available from calling build-python-package.yml before this workflow
       - name: Download dist
-        uses: actions/download-artifact@v3
+        uses: actions/download-artifact@v4
         with:
           name: dist-${{ inputs.package }}
           path: plugins/${{ inputs.package }}/dist/
@@ -41,29 +41,16 @@ jobs:
       - name: Run make_docs.py
         run: python plugins/${{ inputs.package }}/make_docs.py
 
-      - name: Setup rclone
+      - name: Sync to the plugins folder
         # pull requests should run the make_docs.py script, but not sync the docs
         if: inputs.event_name == 'push'
-        run: |
-          sudo apt-get update
-          sudo apt-get install -y rclone
-
-          mkdir -p $HOME/.config
-          mkdir -p $HOME/.config/rclone
-
-          cat << EOF > $HOME/.config/rclone/rclone.conf
-          [plugindocs]
-          type = google cloud storage
-          service_account_file = $HOME/credentials.json
-          project_number = ${{ secrets.DOCS_GOOGLE_CLOUD_PROJECT_NUMBER }}
-          bucket_policy_only = true
-          EOF
-          
-          echo ${{ secrets.DOCS_GOOGLE_CLOUD_CREDENTIALS }} | base64 -d > $HOME/credentials.json
-
-      - name: Sync docs
-        if: inputs.event_name == 'push'
-        run: rclone sync plugins/${{ inputs.package }}/docs/build/markdown/ plugindocs:${{ secrets.DOCS_GOOGLE_CLOUD_BUCKET }}/deephaven/deephaven-plugins/${{ inputs.package }}/${{ inputs.version }}/
+        uses: deephaven/salmon-sync@v1
+        with:
+          source: plugins/${{ inputs.package }}/docs/build/markdown/
+          destination: deephaven/deephaven-plugins/${{ inputs.package }}/${{ inputs.version }}/
+          project_number: ${{ secrets.DOCS_GOOGLE_CLOUD_PROJECT_NUMBER}}
+          bucket: ${{ vars.DOCS_GOOGLE_CLOUD_BUCKET }}
+          credentials: ${{ secrets.DOCS_GOOGLE_CLOUD_CREDENTIALS }}
 
       - name: Setup gsutil auth
         if: inputs.fix_mime_types == true
diff --git a/.github/workflows/modified-plugin.yml b/.github/workflows/modified-plugin.yml
index e35d7fd19..f9d326e52 100644
--- a/.github/workflows/modified-plugin.yml
+++ b/.github/workflows/modified-plugin.yml
@@ -27,8 +27,9 @@ jobs:
     steps:
       - name: Checkout
         uses: actions/checkout@v4
+
       - name: Filter paths
-        uses: dorny/paths-filter@v2
+        uses: dorny/paths-filter@v3
         id: filter
         with:
           filters: |
diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml
index a37942ea7..3cbec8da7 100644
--- a/.github/workflows/pre-commit.yml
+++ b/.github/workflows/pre-commit.yml
@@ -1,4 +1,4 @@
-name: Pre-commit for Black and Blacken-docs
+name: Pre-commit for code style and formatting checks
 
 on:
   push:
@@ -17,5 +17,7 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v4
-      - uses: actions/setup-python@v3
-      - uses: pre-commit/action@v3.0.0
+      - uses: actions/setup-python@v5
+        with:
+          python-version: '3.8'
+      - uses: pre-commit/action@v3.0.1
diff --git a/.github/workflows/release-python-package.yml b/.github/workflows/release-python-package.yml
index b49e842ea..a41c00fad 100644
--- a/.github/workflows/release-python-package.yml
+++ b/.github/workflows/release-python-package.yml
@@ -31,7 +31,7 @@ jobs:
         uses: actions/checkout@v4
 
       - name: Download dist
-        uses: actions/download-artifact@v3
+        uses: actions/download-artifact@v4
         with:
           name: dist-${{ inputs.package }}
           path: plugins/${{ inputs.package }}/dist/


Test patch:
diff --git a/.github/workflows/test-js-packages.yml b/.github/workflows/test-js-packages.yml
index e9ef6a531..8d50cba59 100644
--- a/.github/workflows/test-js-packages.yml
+++ b/.github/workflows/test-js-packages.yml
@@ -42,18 +42,17 @@ jobs:
           restore-keys: |
             ${{ runner.os }}-lintcache-
 
-      - name: Cache node modules
-        id: cache-node-modules
-        uses: actions/cache@v4
+      - name: Restore cached node modules
+        id: restore-node-modules
+        uses: actions/cache/restore@v4
         with:
-          save-always: true
           path: |
             node_modules
             plugins/**/node_modules
           key: unit-node-modules-${{ hashFiles('package-lock.json')}}
 
       - name: Install dependencies
-        if: steps.cache-node-modules.outputs.cache-hit != 'true'
+        if: steps.restore-node-modules.outputs.cache-hit != 'true'
         run: npm ci --no-audit
 
       # Run all tests for all the packages
@@ -61,3 +60,13 @@ jobs:
       # Then there's caches in all plugin folders
       - name: Run Tests
         run: npm run test:ci
+
+      - name: Always cache node modules
+        id: cache-node-modules
+        if: always() && steps.restore-node-modules.outputs.cache-hit != 'true'
+        uses: actions/cache/save@v4
+        with:
+          key: ${{ steps.restore-node-modules.outputs.cache-primary-key }}
+          path: |
+            node_modules
+            plugins/**/node_modules
diff --git a/.github/workflows/test-python-package.yml b/.github/workflows/test-python-package.yml
index 268c69d33..4e43d46c6 100644
--- a/.github/workflows/test-python-package.yml
+++ b/.github/workflows/test-python-package.yml
@@ -18,7 +18,7 @@ jobs:
         uses: actions/checkout@v4
 
       - name: Setup Python
-        uses: actions/setup-python@v4
+        uses: actions/setup-python@v5
         with:
           python-version: ${{ matrix.python }}