From 81256e29b5798cd9b4e15e1eabb5a7ae48897ae0 Mon Sep 17 00:00:00 2001 From: pcarillion Date: Mon, 3 Jun 2024 11:47:02 +0200 Subject: [PATCH 1/6] chore-cicd-ghactions --- .github/workflows/tests.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..7b51ec9 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,21 @@ +name: Cypress Tests + +on: + push: + branches: [master, develop] + pull_request: {} + workflow_dispatch: + +jobs: + cypress-run: + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + # Install npm dependencies, cache them correctly + # and run all Cypress tests + - name: Cypress run + uses: cypress-io/github-action@v6 + with: + build: yarn build + start: yarn start From dc1acaf167c47292443131037085bebe57d6c4f7 Mon Sep 17 00:00:00 2001 From: pcarillion Date: Mon, 3 Jun 2024 11:55:15 +0200 Subject: [PATCH 2/6] chore(ci/cd): test GHA workflow --- .github/workflows/tests.yml | 7 +++++++ README.md | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7b51ec9..b9bf130 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,6 +6,13 @@ on: pull_request: {} workflow_dispatch: +env: + SUDFA_BACKEND_BASE_URL: "" # Not needed for tests but must not be undefined + NODEMAILER_EMAIL: ${{ secrets.NODEMAILER_EMAIL }} + NODEMAILER_PASS: ${{ secrets.NODEMAILER_PASS }} + NODEMAILER_SERVICE: ${{ secrets.NODEMAILER_SERVICE }} + BASE_URL: "http://localhost:3000" + jobs: cypress-run: runs-on: ubuntu-22.04 diff --git a/README.md b/README.md index 433369d..d79a2b3 100755 --- a/README.md +++ b/README.md @@ -61,3 +61,7 @@ Pour utiliser Payload, il suffit de fournir l'url de l'API dans la variable `SUD ## Déploiement Le projet est automatiquement déployé sur Netlify lors du push sur la branche master. + +## Tests e2E + +Des tests e2e sur Cypress ont été ajoutés, notamment pour tester le formulaire de contact. From 294c6f03557c9b52767a0306132c376f73296dce Mon Sep 17 00:00:00 2001 From: pcarillion Date: Mon, 3 Jun 2024 11:59:13 +0200 Subject: [PATCH 3/6] build to dev --- .github/workflows/tests.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b9bf130..a3c92b6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: Cypress Tests +name: Run all tests on: push: @@ -24,5 +24,4 @@ jobs: - name: Cypress run uses: cypress-io/github-action@v6 with: - build: yarn build - start: yarn start + dev: yarn dev From 5581864d96b1884a4ff7101ce49279a3b3cf0a24 Mon Sep 17 00:00:00 2001 From: pcarillion Date: Mon, 3 Jun 2024 12:01:14 +0200 Subject: [PATCH 4/6] build to dev --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a3c92b6..9edaa5a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,4 +24,4 @@ jobs: - name: Cypress run uses: cypress-io/github-action@v6 with: - dev: yarn dev + start: yarn dev From dc0d725ec6933cb19c15d787870566ae585441dc Mon Sep 17 00:00:00 2001 From: pcarillion Date: Mon, 3 Jun 2024 12:03:50 +0200 Subject: [PATCH 5/6] backendurl mock --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9edaa5a..53c34dd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: env: - SUDFA_BACKEND_BASE_URL: "" # Not needed for tests but must not be undefined + SUDFA_BACKEND_BASE_URL: "http://localhost:3001/api/" # Not needed for tests but must not be undefined NODEMAILER_EMAIL: ${{ secrets.NODEMAILER_EMAIL }} NODEMAILER_PASS: ${{ secrets.NODEMAILER_PASS }} NODEMAILER_SERVICE: ${{ secrets.NODEMAILER_SERVICE }} From ab7c07db43610010b8e40e1d35616a513c0bcdda Mon Sep 17 00:00:00 2001 From: pcarillion Date: Mon, 3 Jun 2024 12:11:39 +0200 Subject: [PATCH 6/6] backendurl prod --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 53c34dd..3ddc87a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: env: - SUDFA_BACKEND_BASE_URL: "http://localhost:3001/api/" # Not needed for tests but must not be undefined + SUDFA_BACKEND_BASE_URL: "https://sudfa-media-payload.vercel.app/api/" # Not needed for tests but must not be undefined NODEMAILER_EMAIL: ${{ secrets.NODEMAILER_EMAIL }} NODEMAILER_PASS: ${{ secrets.NODEMAILER_PASS }} NODEMAILER_SERVICE: ${{ secrets.NODEMAILER_SERVICE }}