From 08c9a9d9d9ae010544e5886f66f591c5189df441 Mon Sep 17 00:00:00 2001 From: resonic-user Date: Sun, 15 Jun 2025 21:09:01 +0000 Subject: [PATCH] e2e# --- .github/workflows/test-e2e.yml | 36 ++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 6ae1e200b..a094edf84 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -54,19 +54,23 @@ jobs: - uses: actions/setup-node@v4 with: node-version: '20' - - name: Setup .env and backend deps - run: | - cp backend/.env.test_e2e backend/.env || touch backend/.env - cd backend - yarn install - yarn build + - name: Generate backend cache key + id: backend-key + run: echo "key=node-modules-${{ runner.os }}-${{ hashFiles('backend/yarn.lock') }}" >> $GITHUB_OUTPUT - name: Cache backend node_modules uses: actions/cache@v4 with: path: backend/node_modules - key: node-modules-${{ runner.os }}-${{ hashFiles('backend/yarn.lock') }} + key: ${{ steps.backend-key.outputs.key }} restore-keys: | node-modules-${{ runner.os }}- + node-modules- + - name: Setup .env and backend deps + run: | + cp backend/.env.test_e2e backend/.env || touch backend/.env + cd backend + if [ ! -d "node_modules" ]; then yarn install; fi + yarn build - name: Upload backend build uses: actions/upload-artifact@v4 with: @@ -81,17 +85,21 @@ jobs: - uses: actions/setup-node@v4 with: node-version: '20' - - name: Setup .env and webapp deps - run: | - cp webapp/.env.template webapp/.env || touch webapp/.env - (cd webapp && yarn install || true) + - name: Generate webapp cache key + id: webapp-key + run: echo "key=node-modules-${{ runner.os }}-${{ hashFiles('webapp/yarn.lock') }}" >> $GITHUB_OUTPUT - name: Cache webapp node_modules uses: actions/cache@v4 with: path: webapp/node_modules - key: node-modules-${{ runner.os }}-${{ hashFiles('webapp/yarn.lock') }} + key: ${{ steps.webapp-key.outputs.key }} restore-keys: | node-modules-${{ runner.os }}- + node-modules- + - name: Setup .env and webapp deps + run: | + cp webapp/.env.template webapp/.env || touch webapp/.env + if [ ! -d "webapp/node_modules" ]; then (cd webapp && yarn install || true); fi prepare_cypress: name: Prepare Cypress @@ -137,6 +145,7 @@ jobs: key: node-modules-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} restore-keys: | node-modules-${{ runner.os }}- + node-modules- - name: Download Docker image tarballs uses: actions/download-artifact@v4 with: @@ -184,4 +193,5 @@ jobs: run: | for i in {1..30}; do curl -sf http://localhost:3000 && exit 0 || sleep 2; done; exit 1 - name: Run Cypress tests - run: yarn run cypress:run --spec $(cypress/parallel-features.sh ${{ matrix.job }} ${{ env.jobs }}) \ No newline at end of file + run: | + yarn run cypress:run --spec $(cypress/parallel-features.sh ${{ matrix.job }} ${{ env.jobs }})