From 34f7dfe21449c4bf0636b832567fee5edabf7a8f Mon Sep 17 00:00:00 2001 From: resonic-user Date: Mon, 16 Jun 2025 12:30:57 +0000 Subject: [PATCH] v --- .github/workflows/cache-verify.yml | 37 ++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cache-verify.yml b/.github/workflows/cache-verify.yml index 902f19046..2e1215c58 100644 --- a/.github/workflows/cache-verify.yml +++ b/.github/workflows/cache-verify.yml @@ -41,7 +41,7 @@ jobs: name: ${{ matrix.name }}-image path: /tmp/${{ matrix.name }}.tar - build-environment: + cache-environment: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -50,23 +50,28 @@ jobs: node-version: '20' - id: cache-key env: - LOCK_HASH: ${{ hashFiles('backend/yarn.lock', 'webapp/yarn.lock') }} - run: echo "key=node-modules-${{ runner.os }}-${{ env.LOCK_HASH }}" >> $GITHUB_OUTPUT + LOCK_HASH: ${{ hashFiles('backend/yarn.lock', 'webapp/yarn.lock', 'cypress/yarn.lock') }} + run: echo "key=ci-all-cache-${{ runner.os }}-${{ env.LOCK_HASH }}" >> $GITHUB_OUTPUT - name: Show lockfile hashes (debug) run: | echo "backend/yarn.lock hash: ${{ hashFiles('backend/yarn.lock') }}" echo "webapp/yarn.lock hash: ${{ hashFiles('webapp/yarn.lock') }}" - - name: Restore node_modules cache + echo "cypress/yarn.lock hash: ${{ hashFiles('cypress/yarn.lock') }}" + - name: Restore full CI cache id: restore-cache uses: actions/cache@v4 with: path: | backend/node_modules webapp/node_modules + cypress/node_modules + node_modules + ~/.cache/Cypress + /opt/cucumber-json-formatter key: ${{ steps.cache-key.outputs.key }} restore-keys: | - node-modules-${{ runner.os }}- - node-modules- + ci-all-cache-${{ runner.os }}- + ci-all-cache- - name: Show cache hit status run: | if [[ "${{ steps.restore-cache.outputs.cache-hit }}" == "true" ]]; then @@ -75,9 +80,27 @@ jobs: echo "❌ Cache was missed." fi + - name: Ensure Cypress binary is present + run: | + if [ ! -x "$(command -v cypress)" ]; then + yarn global add cypress + fi + npx cypress verify + - name: Ensure cucumber-json-formatter present + run: | + if [ ! -f /opt/cucumber-json-formatter ]; then + wget --no-verbose -O /opt/cucumber-json-formatter "https://github.com/cucumber/json-formatter/releases/download/v19.0.0/cucumber-json-formatter-linux-386" + chmod +x /opt/cucumber-json-formatter + fi + - name: Print Cypress version + run: npx cypress --version + - name: Check Formatter + run: /opt/cucumber-json-formatter --help || echo "Formatter missing" + + consolidate-environment: runs-on: ubuntu-latest - needs: [build-images, build-environment] + needs: [build-images, cache-environment] steps: - uses: actions/checkout@v4 - name: Download Docker image artifacts