From 7a2ef0be14f776c84e3cbae06572abc416d158d1 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Tue, 12 Nov 2024 11:37:15 -0800 Subject: [PATCH] Put cacheing in the right place --- .github/workflows/doc-extraction.yml | 36 +++++++++++++--------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/.github/workflows/doc-extraction.yml b/.github/workflows/doc-extraction.yml index b6e610e58..73322aed7 100644 --- a/.github/workflows/doc-extraction.yml +++ b/.github/workflows/doc-extraction.yml @@ -48,7 +48,7 @@ jobs: swift-version: ${{ env.swift-version }} cache-snapshot: false # Workaround for https://github.com/SwiftyLab/setup-swift/issues/315 - - name: Install LLVM + - name: Install LLVM and create its pkgconfig file # 7z doesn't support decompressing from a stream or we'd do this all as one statement. Maybe # we should find a way to use zstd on windows. run: >- @@ -58,16 +58,25 @@ jobs: tar -x --zstd -f ${{ env.llvm_package_basename }}.tar.zst - - name: Create LLVM pkgconfig file and make it findable - run: >- - set -ex -o pipefail - PATH="${{ github.workspace }}/${{ env.llvm_package_basename }}/bin:$PATH" ./Tools/make-pkgconfig.sh llvm.pc - echo 'PKG_CONFIG_PATH=${{ github.workspace }}' >> $GITHUB_ENV + - name: Prepare shell environment + run: | + echo "PKG_CONFIG_PATH=${{ github.workspace }} + REPO_SANS_OWNER=${GITHUB_REPOSITORY##*/} + REF_URL_COMPONENT=${GITHUB_REF##*/} + HYLO_ENABLE_DOC_GENERATION=1 + " >> "${GITHUB_ENV}" + + - uses: actions/cache@v4 + with: + path: .build + key: ${{ runner.os }}-debug-spm-${{ hashFiles('./**/Package.resolved') }} + restore-keys: | + ${{ runner.os }}-debug-spm- - - name: Prepare Shell Environment + - name: Compute the Extraction Targets # The format of the ${GITHUB_ENV} file is extremely restrictive; it apparently only supports # lines of the form: # @@ -80,24 +89,13 @@ jobs: # FIXME: REF_URL_COMPONENT computation is probably wrong for some refs. run: | - echo "PKG_CONFIG_PATH=$PWD - REPO_SANS_OWNER=${GITHUB_REPOSITORY##*/} - REF_URL_COMPONENT=${GITHUB_REF##*/} - EXTRACTION_TARGETS=$( + echo "EXTRACTION_TARGETS=$( swift package dump-package | jq '.targets | map(select(.type | test("^(regular|executable)$"))) | .[].name' | xargs ) - HYLO_ENABLE_DOC_GENERATION=1 " >> "${GITHUB_ENV}" - - uses: actions/cache@v4 - with: - path: .build - key: ${{ runner.os }}-debug-spm-${{ hashFiles('./**/Package.resolved') }} - restore-keys: | - ${{ runner.os }}-debug-spm- - - name: Generate Index Page run: | mkdir -p _site