Skip to content

Commit

Permalink
Initialisation Playwright
Browse files Browse the repository at this point in the history
  • Loading branch information
bbaret committed Aug 14, 2024
1 parent 291c769 commit ef0f7b6
Showing 1 changed file with 28 additions and 18 deletions.
46 changes: 28 additions & 18 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,28 @@ jobs:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- name: Récupération du code
uses: actions/checkout@v4

- name: Installation de Node.JS 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x

- name: Installation des dépendances NPM
run: npm ci

- name: Récupération du cache des navigateurs Playwright (${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }})
uses: actions/cache@v3
id: playwright-cache
with:
path: "~/.cache/ms-playwright"
key: "${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}"
restore-keys: ${{ runner.os }}-playwright-

- name: Installation des navigateurs Playwright
run: npx playwright install --with-deps

- name: Obtenir l'URL de preview Vercel
uses: zentered/vercel-preview-url@v1.1.9
id: vercel_preview_url
Expand All @@ -15,6 +37,7 @@ jobs:
with:
vercel_team_id: 'team_XNy8GPxmIHotpZqqeAyKBm79'
vercel_project_id: 'prj_AGcOI1rKi80YLDCPDpwEnNHyJ1wc'

- name: Attente du déploiement de la preview
uses: UnlyEd/github-action-await-vercel@v1
id: await-vercel
Expand All @@ -25,30 +48,17 @@ jobs:
timeout: 180
poll-interval: 1

- name: Récupération du code
uses: actions/checkout@v4
- name: Installation de Node.JS 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Installation des dépendances NPM
run: npm ci
- name: Récupération du cache des navigateurs Playwright (${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }})
uses: actions/cache@v3
id: playwright-cache
with:
path: "~/.cache/ms-playwright"
key: "${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}"
restore-keys: ${{ runner.os }}-playwright-
- name: Installation des navigateurs Playwright
run: npx playwright install --with-deps
- name: Execution des tests Playwright
run: npx playwright test
env:
BASE_URL: ${{ steps.vercel_preview_url.outputs.preview_url }}

- name: Ajout du commentaire dans la PR
run: npx github-actions-ctrf ctrf/ctrf-report.json
run: npx github-actions-ctrf ctrf/ctrf-report.json --pr-comment
if: always()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Mise à disposition des résultats
uses: actions/upload-artifact@v4
if: always()
Expand Down

0 comments on commit ef0f7b6

Please sign in to comment.