feat(ci): added cypress binaries cache to e2e github actions #661
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Playwright | |
on: [push] | |
env: | |
NEXT_PUBLIC_WEBSITE_API_GRAPHQL: "https://reva.incubateur.net/api/graphql" | |
NEXT_PUBLIC_WEBSITE_STRAPI_BASE_URL: "https://strapi.vae.gouv.fr" | |
jobs: | |
playwright-reva-website: | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./packages/reva-website | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
cache: "npm" | |
- name: Website node_modules cache | |
id: website-node_modules-cache | |
uses: actions/cache@v4 | |
with: | |
path: ./packages/reva-website/node_modules | |
key: node_modules-${{ hashFiles('**/package-lock.json') }} | |
- name: Installing dependencies | |
if: steps.website-node_modules-cache.outputs.cache-hit != 'true' | |
run: npm ci | |
- name: Get Playwright version | |
run: echo "PLAYWRIGHT_VERSION=`npm list | grep '@playwright/test'|sed 's/.*playwright\/test@//'`" >> $GITHUB_ENV | |
- name: Cache Playwright Binaries | |
id: cache-playwright | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cache/ms-playwright | |
key: playwright-${{ env.PLAYWRIGHT_VERSION }} | |
- name: Install Playwright Browsers | |
if: steps.cache-playwright.outputs.cache-hit != 'true' | |
run: npx playwright install --with-deps | |
- name: Build to retrieve graphql schema from API folder | |
run: npm run build | |
- name: Run Playwright tests | |
run: npm run test | |
- uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 30 | |
playwright-reva-vae-collective: | |
timeout-minutes: 30 | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./packages/reva-vae-collective | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22.x | |
cache: "npm" | |
- name: VAE Collective node_modules cache | |
id: vae-collective-node_modules-cache | |
uses: actions/cache@v4 | |
with: | |
path: ./packages/reva-vae-collective/node_modules | |
key: node_modules-${{ hashFiles('**/package-lock.json') }} | |
- name: Installing dependencies | |
if: steps.vae-collective-node_modules-cache.outputs.cache-hit != 'true' | |
run: npm ci | |
- name: Get Playwright version | |
run: echo "PLAYWRIGHT_VERSION=`npm list | grep '@playwright/test'|sed 's/.*playwright\/test@//'`" >> $GITHUB_ENV | |
- name: Cache Playwright Binaries | |
id: cache-playwright | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cache/ms-playwright | |
key: playwright-${{ env.PLAYWRIGHT_VERSION }} | |
- name: Install Playwright Browsers | |
if: steps.cache-playwright.outputs.cache-hit != 'true' | |
run: npx playwright install --with-deps | |
- name: Build to retrieve graphql schema from API folder | |
run: npm run build | |
- name: Run Playwright tests | |
run: npm run test | |
- uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 30 |