From 5e4739c61cb387fb0c2356d091f8f02e62552edb Mon Sep 17 00:00:00 2001 From: Renato Freire Date: Fri, 19 Jan 2024 16:55:54 -0300 Subject: [PATCH 1/8] Adiciona json-server-auth e configura arquivo de rotas MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - também altera caminho de arquivos default para pasta `server/` --- README.md | 7 ++++++- action.yml | 6 +++++- entrypoint.sh | 3 ++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4d1eb69..ceedda5 100644 --- a/README.md +++ b/README.md @@ -46,10 +46,15 @@ This action evaluate Tryber projects with [Cypress](https://www.npmjs.com/packag - `json-server-db` - **Default: db.json** + **Default: server/db.json** Define json-server db file. +- `json-server-routes` + + **Default: server/routes.json** + + Define json-server routes file. ## Outputs diff --git a/action.yml b/action.yml index 2a84fa3..19d2f16 100644 --- a/action.yml +++ b/action.yml @@ -21,7 +21,10 @@ inputs: default: "3050" json-server-db: description: "Define json-server db file" - default: "db.json" + default: "server/db.json" + json-server-routes: + description: "Define json-server route file" + default: "server/routes.json" outputs: result: @@ -36,3 +39,4 @@ runs: - ${{ inputs.json-server }} - ${{ inputs.json-server-port }} - ${{ inputs.json-server-db }} + - ${{ inputs.json-server-routes }} diff --git a/entrypoint.sh b/entrypoint.sh index df496fb..e975b20 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -7,6 +7,7 @@ CYPRESS_BROWSER=$3 RUN_JSON_SERVER=$4 JSON_SERVER_PORT=$5 JSON_SERVER_DB=$6 +JSON_SERVER_ROUTES=$7 export CY_CLI=true @@ -18,7 +19,7 @@ if $RUN_NPM_START ; then fi if $RUN_JSON_SERVER ; then - npx json-server --watch $JSON_SERVER_DB --port $JSON_SERVER_PORT & + npx json-server-auth --watch $JSON_SERVER_DB -r $JSON_SERVER_ROUTES --port $JSON_SERVER_PORT & npx wait-on -t 300000 http://localhost:$JSON_SERVER_PORT fi From 2b64895e2f862976c79946fd67931ffbce6578e3 Mon Sep 17 00:00:00 2001 From: Renato Freire Date: Mon, 22 Jan 2024 23:40:51 -0300 Subject: [PATCH 2/8] Adiciona delay --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index e975b20..b35706d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -19,7 +19,7 @@ if $RUN_NPM_START ; then fi if $RUN_JSON_SERVER ; then - npx json-server-auth --watch $JSON_SERVER_DB -r $JSON_SERVER_ROUTES --port $JSON_SERVER_PORT & + npx json-server-auth --watch $JSON_SERVER_DB -r $JSON_SERVER_ROUTES --port $JSON_SERVER_PORT --delay 1500 & npx wait-on -t 300000 http://localhost:$JSON_SERVER_PORT fi From 5fbcf951ec66c1cbaa1941bd9b83676d6eba1b6b Mon Sep 17 00:00:00 2001 From: Renato Freire Date: Tue, 23 Jan 2024 10:39:59 -0300 Subject: [PATCH 3/8] Adiciona rota /users no comando wait-on --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index b35706d..c9bb295 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -20,7 +20,7 @@ fi if $RUN_JSON_SERVER ; then npx json-server-auth --watch $JSON_SERVER_DB -r $JSON_SERVER_ROUTES --port $JSON_SERVER_PORT --delay 1500 & - npx wait-on -t 300000 http://localhost:$JSON_SERVER_PORT + npx wait-on -t 300000 http://localhost:$JSON_SERVER_PORT/users fi headless_flag='' From efb1d4726f71a2b5ce3a0cba88758d0f86f66c36 Mon Sep 17 00:00:00 2001 From: Renato Freire Date: Wed, 24 Jan 2024 11:11:31 -0300 Subject: [PATCH 4/8] Update action.yml --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 19d2f16..40de929 100644 --- a/action.yml +++ b/action.yml @@ -21,10 +21,10 @@ inputs: default: "3050" json-server-db: description: "Define json-server db file" - default: "server/db.json" + default: "db.json" json-server-routes: description: "Define json-server route file" - default: "server/routes.json" + default: "routes.json" outputs: result: From e05fbbb35a7fe1deda61395d48a87c67e1cc86ac Mon Sep 17 00:00:00 2001 From: Renato Freire Date: Wed, 24 Jan 2024 11:16:16 -0300 Subject: [PATCH 5/8] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ceedda5..00fe0c9 100644 --- a/README.md +++ b/README.md @@ -46,13 +46,13 @@ This action evaluate Tryber projects with [Cypress](https://www.npmjs.com/packag - `json-server-db` - **Default: server/db.json** + **Default: db.json** Define json-server db file. - `json-server-routes` - **Default: server/routes.json** + **Default: routes.json** Define json-server routes file. From e838078c933744b30a032d0dfe9dbf511ca75d6f Mon Sep 17 00:00:00 2001 From: Renato Freire Date: Wed, 24 Jan 2024 11:18:37 -0300 Subject: [PATCH 6/8] Atualiza imagem docker --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 40de929..f1838a0 100644 --- a/action.yml +++ b/action.yml @@ -31,7 +31,7 @@ outputs: description: "Cypress unit tests JSON results in base64 format." runs: using: "docker" - image: "docker://betrybe/cypress-evaluator-action:v9.0" + image: "docker://betrybe/cypress-evaluator-action:v10.1.0-alpha" args: - ${{ inputs.npm-start }} - ${{ inputs.headless }} From 85de27037877c0ccd8dd40dcddb0dfe10818d934 Mon Sep 17 00:00:00 2001 From: Renato Freire Date: Wed, 24 Jan 2024 14:18:14 -0300 Subject: [PATCH 7/8] =?UTF-8?q?Altera=20vers=C3=A3o=20da=20imagem=20docker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index f1838a0..c1d82a4 100644 --- a/action.yml +++ b/action.yml @@ -31,7 +31,7 @@ outputs: description: "Cypress unit tests JSON results in base64 format." runs: using: "docker" - image: "docker://betrybe/cypress-evaluator-action:v10.1.0-alpha" + image: "docker://betrybe/cypress-evaluator-action:v10.0" args: - ${{ inputs.npm-start }} - ${{ inputs.headless }} From 44fd9339761c7f9c16ba8305cda4c359ac630ac9 Mon Sep 17 00:00:00 2001 From: Renato Freire Date: Wed, 24 Jan 2024 14:40:34 -0300 Subject: [PATCH 8/8] =?UTF-8?q?Define=20pasta=20padR=C3=A3o=20como=20`serv?= =?UTF-8?q?er`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- action.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 00fe0c9..47dfc46 100644 --- a/README.md +++ b/README.md @@ -46,13 +46,13 @@ This action evaluate Tryber projects with [Cypress](https://www.npmjs.com/packag - `json-server-db` - **Default: db.json** + **Default: ./server/db.json** Define json-server db file. - `json-server-routes` - **Default: routes.json** + **Default: ./server/routes.json** Define json-server routes file. diff --git a/action.yml b/action.yml index c1d82a4..3d31a23 100644 --- a/action.yml +++ b/action.yml @@ -21,10 +21,10 @@ inputs: default: "3050" json-server-db: description: "Define json-server db file" - default: "db.json" + default: "./server/db.json" json-server-routes: description: "Define json-server route file" - default: "routes.json" + default: "./server/routes.json" outputs: result: