diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 129d8bc5..a1cc5580 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,7 +30,28 @@ jobs: npm run prettier npm run lint - test: + unit-test: + runs-on: ubuntu-latest + env: + cache-name: cache-node-modules + + steps: + - uses: actions/checkout@v3 + - name: Cache node modules + uses: actions/cache@v3 + with: + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + - name: Run unit tests + run: | + npm ci + npm run test + + e2e-test: runs-on: ubuntu-latest environment: azure-prod env: @@ -51,14 +72,10 @@ jobs: ${{ runner.os }}-build-${{ env.cache-name }}- ${{ runner.os }}-build- ${{ runner.os }}- - - name: Run unit tests - run: | - npm ci - npm run test - name: Run e2e tests run: | - npm ci - E2E_HOST=${{env.E2E_HOST}} E2E_PATH=${{env.E2E_PATH}} E2E_ACCESS_TOKEN=${{env.E2E_ACCESS_TOKEN}} NODE_OPTIONS="--max-old-space-size=4096" npm run e2e + E2E_HOST=${{ env.E2E_HOST }} E2E_PATH=${{env.E2E_PATH}} E2E_ACCESS_TOKEN=${{env.E2E_ACCESS_TOKEN}} npm ci + NODE_OPTIONS="--max-old-space-size=4096" npm run e2e - name: Coverage uses: codecov/codecov-action@v3 with: