commit 482571d558310dd8f248f7eedc056e17f99d00b1 Author: Skydust Date: Fri Apr 4 08:46:42 2025 +0200 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1f1025f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea +.DS_Store \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9d4cb99 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM cypress/base:22.13.1 + +RUN npm config set @skydust:registry=https://gitea.skydust.fr/api/packages/skydust/npm/ +RUN npm install -g @skydust/toolkit@1.2.3 +RUN npm install -g corepack@latest + +RUN apt-get update +RUN apt-get install --yes firefox-esr +RUN apt-get clean + +COPY ./entrypoint.sh / +RUN chmod +x /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..209b210 --- /dev/null +++ b/action.yml @@ -0,0 +1,13 @@ +name: Cypress runner +description: Runs the cypress binary from the project +author: Skydust + +# Define your inputs here. +inputs: + baseUrl: + description: The server url + required: true + +runs: + using: docker + image: Dockerfile diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..e89000e --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +INPUT_BASE_URL=$baseUrl + +set -e + +CY_ACTION_PATH="/e2e" + +cd "${CY_ACTION_PATH}" + +export CYPRESS_BASE_URL="${INPUT_BASE_URL}" + +if ! [[ -d "node_modules" ]]; then + log_info "$(red)Error: No node_modules found" + exit 1 +fi + +log_info "Install cypress binaries" +npx cypress install + +log_info "Running cypress cy:test" + +npm run cy:test