From 81cb9067c69e3ed76c3fd93b3a8ff721fa1d2d4b Mon Sep 17 00:00:00 2001 From: Bogdan Kuternoga Date: Fri, 23 Aug 2024 12:19:06 +0200 Subject: [PATCH] feat: refactoring of e2e workflow --- .github/workflows/e2e.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index a3fd500..7f03df1 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -8,6 +8,8 @@ jobs: test: timeout-minutes: 60 runs-on: ubuntu-latest + env: + PLAYWRIGHT_BROWSERS_PATH: pw-browsers/ defaults: run: working-directory: ./e2e @@ -15,14 +17,24 @@ jobs: - uses: actions/checkout@v4 - name: Read .nvmrc id: nvmrc - run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc) + run: echo "NODE_VERSION=$(cat .nvmrc)" >> "$GITHUB_OUTPUT" - uses: actions/setup-node@v4 with: - node-version: ${{ steps.nvm.outputs.NODE_VERSION }} + node-version: $NODE_VERSION + - name: Cache node modules + uses: actions/cache@v2 + with: + path: e2e/node_modules + key: "${{ runner.os }}-node-${{ hashFiles('e2e/package-lock.json') }}" + - name: Cache browser + uses: actions/cache@v2 + with: + path: $PLAYWRIGHT_BROWSERS_PATH + key: "${{ runner.os }}-node-${{ hashFiles('e2e/package-lock.json') }}" - name: Install dependencies run: npm ci - name: Install Playwright Browsers - run: npm run pw install chromium --with-deps + run: npm run pw install chromium --with-deps --force - name: Run Playwright tests run: npm test - uses: actions/upload-artifact@v4