From 08add3844991ee912cbb5fdcbe004ab0462a081f Mon Sep 17 00:00:00 2001 From: Bruce Weirdan Date: Sun, 12 Mar 2023 02:01:01 -0400 Subject: [PATCH] Optimize composer caching Previously our composer package cache would not be updated because we had no `composer.lock` (which hash is used as part of the cache key). Generating `composer.lock` (but not installing packages) before we check the cache fixes this. --- .github/workflows/bcc.yml | 4 ++++ .github/workflows/build-phar.yml | 4 ++++ .github/workflows/ci.yml | 8 ++++++++ .github/workflows/windows-ci.yml | 4 ++++ 4 files changed, 20 insertions(+) diff --git a/.github/workflows/bcc.yml b/.github/workflows/bcc.yml index 6264f7a41..56c8e2985 100644 --- a/.github/workflows/bcc.yml +++ b/.github/workflows/bcc.yml @@ -23,6 +23,10 @@ jobs: echo "files_cache=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT echo "vcs_cache=$(composer config cache-vcs-dir)" >> $GITHUB_OUTPUT + - name: Generate composer.lock + run: | + composer update --no-install + - name: Cache composer cache uses: actions/cache@v3 with: diff --git a/.github/workflows/build-phar.yml b/.github/workflows/build-phar.yml index 2f7d467a1..4f785f3be 100644 --- a/.github/workflows/build-phar.yml +++ b/.github/workflows/build-phar.yml @@ -52,6 +52,10 @@ jobs: echo "files_cache=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT echo "vcs_cache=$(composer config cache-vcs-dir)" >> $GITHUB_OUTPUT + - name: Generate composer.lock + run: | + composer update --no-install + - name: Cache composer cache uses: actions/cache@v3 with: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 552dc6b73..d4d652519 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,10 @@ jobs: echo "files_cache=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT echo "vcs_cache=$(composer config cache-vcs-dir)" >> $GITHUB_OUTPUT + - name: Generate composer.lock + run: | + composer update --no-install + - name: Cache composer cache uses: actions/cache@v3 with: @@ -97,6 +101,10 @@ jobs: echo "files_cache=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT echo "vcs_cache=$(composer config cache-vcs-dir)" >> $GITHUB_OUTPUT + - name: Generate composer.lock + run: | + composer update --no-install + - name: Cache composer cache uses: actions/cache@v3 with: diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index 396b6fff8..0c0960f86 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -69,6 +69,10 @@ jobs: echo "vcs_cache=$(composer config cache-vcs-dir)" >> $GITHUB_OUTPUT shell: bash + - name: Generate composer.lock + run: | + composer update --no-install + - name: Cache composer cache uses: actions/cache@v3 with: