From 748f85640241df0a1937f1f4d5edc7c732ed85d6 Mon Sep 17 00:00:00 2001 From: ismay Date: Mon, 10 Jun 2024 16:07:44 +0200 Subject: [PATCH] ci: abstract e2e --- .github/workflows/dhis2-verify-app.yml | 19 +------------------ .github/workflows/e2e.yml | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/e2e.yml diff --git a/.github/workflows/dhis2-verify-app.yml b/.github/workflows/dhis2-verify-app.yml index 51210f9e..5b5d8c98 100644 --- a/.github/workflows/dhis2-verify-app.yml +++ b/.github/workflows/dhis2-verify-app.yml @@ -24,24 +24,7 @@ jobs: uses: ./.github/workflows/test.yml e2e: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v3 - with: - node-version: 20 - - name: End-to-End tests - uses: cypress-io/github-action@v5 - with: - start: npx --yes @dhis2/cli-cluster up 2.41 --channel dev --db-version 2.41 --seed, yarn start:nobrowser - wait-on: 'http://localhost:8080/dhis-web-commons/security/login.action, http://localhost:3000' - wait-on-timeout: 600 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CYPRESS_LOGIN_NAME: ${{ secrets.CYPRESS_LOGIN_NAME }} - CYPRESS_LOGIN_PASSWORD: ${{ secrets.CYPRESS_LOGIN_PASSWORD }} - CYPRESS_LOGIN_SERVER: http://localhost:8080 - - run: npx --yes @dhis2/cli-cluster down 2.41 + uses: ./.github/workflows/e2e.yml release: runs-on: ubuntu-latest diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml new file mode 100644 index 00000000..94481391 --- /dev/null +++ b/.github/workflows/e2e.yml @@ -0,0 +1,23 @@ +on: + workflow_call: + +jobs: + e2e: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'yarn' + - uses: cypress-io/github-action@v5 + with: + start: npx --yes @dhis2/cli-cluster up 2.41 --channel dev --db-version 2.41 --seed, yarn start:nobrowser + wait-on: 'http://localhost:8080/dhis-web-commons/security/login.action, http://localhost:3000' + wait-on-timeout: 600 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CYPRESS_LOGIN_NAME: ${{ secrets.CYPRESS_LOGIN_NAME }} + CYPRESS_LOGIN_PASSWORD: ${{ secrets.CYPRESS_LOGIN_PASSWORD }} + CYPRESS_LOGIN_SERVER: http://localhost:8080 + - run: npx --yes @dhis2/cli-cluster down 2.41