From 32223d15056e003989331f481f127da924b99090 Mon Sep 17 00:00:00 2001 From: resonic-user Date: Sun, 15 Jun 2025 20:46:29 +0000 Subject: [PATCH] caching added --- .github/workflows/test-e2e.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 33b631c98..c5d5f9188 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -60,6 +60,19 @@ jobs: cd backend yarn install yarn build + - name: Upload backend build + uses: actions/upload-artifact@v4 + with: + name: backend-build + path: backend/build + - name: Cache node_modules + uses: actions/cache@v4 + with: + path: | + backend/node_modules + webapp/node_modules + key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} + prepare_webapp: name: Prepare webapp runs-on: ubuntu-latest @@ -72,6 +85,13 @@ jobs: run: | cp webapp/.env.template webapp/.env || touch webapp/.env (cd webapp && yarn install || true) + - name: Cache node_modules + uses: actions/cache@v4 + with: + path: | + backend/node_modules + webapp/node_modules + key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} prepare_cypress: name: Prepare Cypress runs-on: ubuntu-latest @@ -125,6 +145,7 @@ jobs: - name: Add node_modules/.bin to PATH run: echo "$(pwd)/node_modules/.bin" >> $GITHUB_PATH + - name: Ensure Cypress CLI is available run: | if ! command -v cypress >/dev/null; then @@ -133,11 +154,13 @@ jobs: else echo "✅ Cypress CLI is present" fi + - name: Setup .env files run: | mkdir -p webapp backend cp webapp/.env.template webapp/.env || touch webapp/.env cp backend/.env.test_e2e backend/.env || touch backend/.env + - name: Download neo4j image tarball uses: actions/download-artifact@v4 with: @@ -161,12 +184,21 @@ jobs: docker load < /tmp/neo4j.tar docker load < /tmp/backend.tar docker load < /tmp/webapp.tar + - name: Start system run: | set -e docker compose -f docker-compose.yml -f docker-compose.test.yml up --detach webapp mailserver - name: Wait for webapp + run: | for i in {1..30}; do curl -sf http://localhost:3000 && exit 0 || sleep 2; done; exit 1 + + - name: Download backend build + uses: actions/download-artifact@v4 + with: + name: backend-build + path: backend/build + - name: Run Cypress tests run: yarn run cypress:run --spec $(cypress/parallel-features.sh ${{ matrix.job }} ${{ env.jobs }}) \ No newline at end of file