@futurelastic/colab-handbook 1.13.0-rc.43 → 1.13.0-rc.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/templates/ci-laravel.yml +28 -0
- package/templates/ci-node.yml +18 -0
- package/templates/ci-python.yml +15 -0
package/package.json
CHANGED
package/templates/ci-laravel.yml
CHANGED
|
@@ -713,6 +713,28 @@ jobs:
|
|
|
713
713
|
extensions: mbstring, sqlite3, pdo_sqlite, bcmath, intl # EDIT: add what this app needs.
|
|
714
714
|
coverage: none
|
|
715
715
|
|
|
716
|
+
# Package cache (#571): Composer's download cache, on only on a GitHub-hosted runner AND
|
|
717
|
+
# with composer.lock present. Both halves are load-bearing:
|
|
718
|
+
# - No composer.lock → nothing stable to key on; every run would save a fresh entry.
|
|
719
|
+
# - Self-hosted → off. A persistent runner already keeps Composer's cache dir between
|
|
720
|
+
# jobs; a remote cache on top was measured as a loss, not a saving (#512).
|
|
721
|
+
# Two NEW steps, both skipped where the gate is off. "Composer install" keeps its name
|
|
722
|
+
# and its body: `colab ship`'s cure rule matches steps by exact name.
|
|
723
|
+
# EDIT: self-hosted runners are already off; to turn caching off everywhere, delete these
|
|
724
|
+
# two steps.
|
|
725
|
+
- name: Locate Composer cache
|
|
726
|
+
id: composer-cache
|
|
727
|
+
if: runner.environment == 'github-hosted' && hashFiles('composer.lock') != ''
|
|
728
|
+
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
|
|
729
|
+
|
|
730
|
+
- name: Restore Composer cache
|
|
731
|
+
if: runner.environment == 'github-hosted' && hashFiles('composer.lock') != ''
|
|
732
|
+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
733
|
+
with:
|
|
734
|
+
path: ${{ steps.composer-cache.outputs.dir }}
|
|
735
|
+
key: composer-${{ runner.os }}-${{ hashFiles('composer.lock') }}
|
|
736
|
+
restore-keys: composer-${{ runner.os }}-
|
|
737
|
+
|
|
716
738
|
- name: Composer install
|
|
717
739
|
env:
|
|
718
740
|
RUN_TESTS: ${{ steps.tier.outputs.run_tests }}
|
|
@@ -747,9 +769,15 @@ jobs:
|
|
|
747
769
|
# stderr and reports only "Command failed".
|
|
748
770
|
php artisan wayfinder:generate $WAYFINDER_ARGS
|
|
749
771
|
|
|
772
|
+
# npm cache (#571): the same gate as the Composer cache above — GitHub-hosted AND
|
|
773
|
+
# package-lock.json present (`cache: npm` fails the step without one). The automatic
|
|
774
|
+
# `packageManager` cache is pinned to the same condition so it cannot override it.
|
|
775
|
+
# EDIT: to turn it off everywhere, replace both expressions with '' and false.
|
|
750
776
|
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
|
|
751
777
|
with:
|
|
752
778
|
node-version: ${{ steps.toolchain.outputs.node-version }}
|
|
779
|
+
cache: ${{ runner.environment == 'github-hosted' && hashFiles('package-lock.json') != '' && 'npm' || '' }}
|
|
780
|
+
package-manager-cache: ${{ runner.environment == 'github-hosted' && hashFiles('package-lock.json') != '' }}
|
|
753
781
|
|
|
754
782
|
- name: Build frontend assets (Vite)
|
|
755
783
|
run: |
|
package/templates/ci-node.yml
CHANGED
|
@@ -646,11 +646,26 @@ jobs:
|
|
|
646
646
|
echo "Node $NODE_VERSION (resolved from: $SOURCE)"
|
|
647
647
|
echo "Node **$NODE_VERSION** — resolved from \`$SOURCE\`" >> "$GITHUB_STEP_SUMMARY"
|
|
648
648
|
|
|
649
|
+
# Package cache (#571): on only on a GitHub-hosted runner AND with package-lock.json
|
|
650
|
+
# present. Both halves are load-bearing:
|
|
651
|
+
# - No lockfile → setup-node's `cache:` fails the step outright ("Dependencies lock
|
|
652
|
+
# file is not found"), and this template allows a repo without one.
|
|
653
|
+
# - Self-hosted → off. A persistent runner already keeps ~/.npm between jobs; a
|
|
654
|
+
# remote cache on top was measured as a loss, not a saving (#512).
|
|
655
|
+
# npm only: `cache: pnpm` needs pnpm on PATH before this step, and the install step
|
|
656
|
+
# below enables it through corepack afterwards. `package-manager-cache` is pinned to
|
|
657
|
+
# the same condition so setup-node's automatic `packageManager` caching cannot switch
|
|
658
|
+
# it back on where the condition says off.
|
|
659
|
+
# EDIT: self-hosted runners are already off; to turn caching off everywhere, replace
|
|
660
|
+
# both expressions with '' and false. If the app is not at the root, point the
|
|
661
|
+
# hashFiles() and a `cache-dependency-path:` at its package-lock.json.
|
|
649
662
|
- name: Setup Node
|
|
650
663
|
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
|
|
651
664
|
if: hashFiles('package.json') != ''
|
|
652
665
|
with:
|
|
653
666
|
node-version: ${{ steps.toolchain.outputs.node-version }}
|
|
667
|
+
cache: ${{ runner.environment == 'github-hosted' && hashFiles('package-lock.json') != '' && 'npm' || '' }}
|
|
668
|
+
package-manager-cache: ${{ runner.environment == 'github-hosted' && hashFiles('package-lock.json') != '' }}
|
|
654
669
|
|
|
655
670
|
- name: Install dependencies
|
|
656
671
|
if: hashFiles('package.json') != ''
|
|
@@ -807,6 +822,9 @@ jobs:
|
|
|
807
822
|
# uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
|
|
808
823
|
# with:
|
|
809
824
|
# node-version: ${{ needs.build.outputs.node-version }}
|
|
825
|
+
# # Same cache gate as the build job's Setup Node (#571): hosted + lockfile only.
|
|
826
|
+
# cache: ${{ runner.environment == 'github-hosted' && hashFiles('package-lock.json') != '' && 'npm' || '' }}
|
|
827
|
+
# package-manager-cache: ${{ runner.environment == 'github-hosted' && hashFiles('package-lock.json') != '' }}
|
|
810
828
|
#
|
|
811
829
|
# - name: Install dependencies
|
|
812
830
|
# run: |
|
package/templates/ci-python.yml
CHANGED
|
@@ -636,9 +636,24 @@ jobs:
|
|
|
636
636
|
echo "Python $PY_VERSION (resolved from: $SOURCE)"
|
|
637
637
|
echo "Python **$PY_VERSION** — resolved from \`$SOURCE\`" >> "$GITHUB_STEP_SUMMARY"
|
|
638
638
|
|
|
639
|
+
# Package cache (#571): pip's wheel cache, on only on a GitHub-hosted runner AND with a
|
|
640
|
+
# dependency manifest present. Both halves are load-bearing:
|
|
641
|
+
# - No requirements*.txt / pyproject.toml → setup-python's `cache: pip` fails the step
|
|
642
|
+
# ("No file ... matched"), and this template allows a repo with neither.
|
|
643
|
+
# - Self-hosted → off. A persistent runner already keeps ~/.cache/pip between jobs; a
|
|
644
|
+
# remote cache on top was measured as a loss, not a saving (#512).
|
|
645
|
+
# The cache holds downloaded wheels, never a resolution: it cannot change which versions
|
|
646
|
+
# install, so a repo without a pinned lockfile is no less reproducible with it on.
|
|
647
|
+
# EDIT: self-hosted runners are already off; to turn caching off everywhere, replace the
|
|
648
|
+
# `cache:` expression with ''. Manifests outside the root → widen cache-dependency-path
|
|
649
|
+
# and the hashFiles() to match.
|
|
639
650
|
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
|
|
640
651
|
with:
|
|
641
652
|
python-version: ${{ steps.toolchain.outputs.python-version }}
|
|
653
|
+
cache: ${{ runner.environment == 'github-hosted' && hashFiles('requirements*.txt', 'pyproject.toml') != '' && 'pip' || '' }}
|
|
654
|
+
cache-dependency-path: |
|
|
655
|
+
requirements*.txt
|
|
656
|
+
pyproject.toml
|
|
642
657
|
|
|
643
658
|
- name: Install dependencies
|
|
644
659
|
run: |
|