From 7fbd7ffaf94f20c721eebccd8547c706f26c060a Mon Sep 17 00:00:00 2001 From: MichalKinas Date: Mon, 26 Aug 2024 12:03:52 +0200 Subject: [PATCH 1/6] [ACS-8660] Introduce daily CI cron workflow --- .github/workflows/cron-e2e.yml | 29 +++++++++++++++++++++++++++++ .github/workflows/pull-request.yml | 17 ++++++++++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/cron-e2e.yml diff --git a/.github/workflows/cron-e2e.yml b/.github/workflows/cron-e2e.yml new file mode 100644 index 0000000000..8a92667310 --- /dev/null +++ b/.github/workflows/cron-e2e.yml @@ -0,0 +1,29 @@ +name: "Daily CI pipeline cron" + +on: + workflow_dispatch: + schedule: + - cron: '0 12 * * 1-5' #At 12:00 on every day-of-week from Monday through Friday. + +env: + BASE_URL: ${{ secrets.PIPELINE_ENV_URL }} + ADMIN_EMAIL: ${{ secrets.PIPELINE_ADMIN_USERNAME }} + ADMIN_PASSWORD: ${{ secrets.PIPELINE_ADMIN_PASSWORD }} + HR_USER: ${{ secrets.HR_USER }} + HR_USER_PASSWORD: ${{ secrets.HR_USER_PASSWORD }} + SCREENSHOT_USERNAME: ${{ secrets.SCREENSHOT_USERNAME }} + SCREENSHOT_PASSWORD: ${{ secrets.SCREENSHOT_PASSWORD}} + PLAYWRIGHT_E2E_HOST: ${{ secrets.PLAYWRIGHT_E2E_HOST }} + GH_BUILD_NUMBER: ${{ github.run_id }} + REPORT_PORTAL_URL: ${{ secrets.REPORT_PORTAL_URL }} + REPORT_PORTAL_TOKEN: ${{ secrets.REPORT_PORTAL_TOKEN }} + MAXINSTANCES: 2 + RETRY_COUNT: 2 + +jobs: + run-e2e: + name: Run e2e + uses: ./.github/workflows/pull-request.yml + with: + cron-run: true + secrets: inherit diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index a1316d0056..a1483bdfa5 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -4,6 +4,13 @@ on: pull_request: types: [opened, synchronize, reopened] branches: [master, develop] + workflow_call: + inputs: + cron-run: + description: 'Disables jobs which should not run during cron execution' + required: false + type: boolean + default: false concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -26,6 +33,7 @@ env: jobs: lint: + if: ${{ inputs.cron-run == 'false' }} name: 'lint' runs-on: ubuntu-latest steps: @@ -84,7 +92,14 @@ jobs: cache: 'npm' - uses: ./.github/actions/before-install - run: npm ci - - run: npm run affected:test -- --browsers=ChromeHeadless --watch=false $TEST_OPTS --base=origin/develop + + - name: Test + if: ${{ inputs.cron-run == 'false' }} + run: npm run affected:test -- --browsers=ChromeHeadless --watch=false $TEST_OPTS --base=origin/develop + + - name: Test all + if: ${{ inputs.cron-run == 'true' }} + run: npx nx run-many --target=test --browsers=ChromeHeadless --watch=false $TEST_OPTS --base=origin/develop e2es-playwright: needs: [lint, build, unit-tests] From 0b7e4a9b89475aee8f64ddf026a8a9c84945a789 Mon Sep 17 00:00:00 2001 From: MichalKinas Date: Mon, 26 Aug 2024 12:21:29 +0200 Subject: [PATCH 2/6] [ACS-8660] Rename workflow file --- .github/workflows/{cron-e2e.yml => daily-ci-cron.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{cron-e2e.yml => daily-ci-cron.yml} (100%) diff --git a/.github/workflows/cron-e2e.yml b/.github/workflows/daily-ci-cron.yml similarity index 100% rename from .github/workflows/cron-e2e.yml rename to .github/workflows/daily-ci-cron.yml From 8ab5fed3bf84a99d9c2540a49b24687b77d33284 Mon Sep 17 00:00:00 2001 From: MichalKinas Date: Mon, 26 Aug 2024 12:34:19 +0200 Subject: [PATCH 3/6] [ACS-8660] Small fix --- .github/workflows/pull-request.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index a1483bdfa5..87c69524e9 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -33,7 +33,6 @@ env: jobs: lint: - if: ${{ inputs.cron-run == 'false' }} name: 'lint' runs-on: ubuntu-latest steps: From ec7aea2f1717ee4e64b07e61ce95935015bf144f Mon Sep 17 00:00:00 2001 From: MichalKinas Date: Mon, 26 Aug 2024 12:48:14 +0200 Subject: [PATCH 4/6] [ACS-8660] Refine cron workflow param --- .github/workflows/daily-ci-cron.yml | 2 +- .github/workflows/pull-request.yml | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/daily-ci-cron.yml b/.github/workflows/daily-ci-cron.yml index 8a92667310..8fce62a62f 100644 --- a/.github/workflows/daily-ci-cron.yml +++ b/.github/workflows/daily-ci-cron.yml @@ -25,5 +25,5 @@ jobs: name: Run e2e uses: ./.github/workflows/pull-request.yml with: - cron-run: true + cron-run: 'true' secrets: inherit diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 87c69524e9..1c7af58d64 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -9,8 +9,8 @@ on: cron-run: description: 'Disables jobs which should not run during cron execution' required: false - type: boolean - default: false + type: string + default: 'false' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -33,6 +33,7 @@ env: jobs: lint: + if: ${{ inputs.cron-run == 'false' }} name: 'lint' runs-on: ubuntu-latest steps: From 38a282c3d5a1921c976b9a959be20fc302054d15 Mon Sep 17 00:00:00 2001 From: MichalKinas Date: Mon, 26 Aug 2024 12:56:09 +0200 Subject: [PATCH 5/6] [ACS-8660] GHA input visibility fix --- .github/workflows/pull-request.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 1c7af58d64..c17250fc78 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -33,7 +33,6 @@ env: jobs: lint: - if: ${{ inputs.cron-run == 'false' }} name: 'lint' runs-on: ubuntu-latest steps: From 7e54db98a3aa8770d180fa739c06d0d458f9922b Mon Sep 17 00:00:00 2001 From: MichalKinas Date: Mon, 26 Aug 2024 13:16:51 +0200 Subject: [PATCH 6/6] [ACS-8660] GHA input fix --- .github/workflows/pull-request.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index c17250fc78..f26a39ae40 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -33,6 +33,7 @@ env: jobs: lint: + if: ${{ inputs.cron-run == 'false' || inputs.cron-run == '' }} name: 'lint' runs-on: ubuntu-latest steps: @@ -93,7 +94,7 @@ jobs: - run: npm ci - name: Test - if: ${{ inputs.cron-run == 'false' }} + if: ${{ inputs.cron-run == 'false' || inputs.cron-run == '' }} run: npm run affected:test -- --browsers=ChromeHeadless --watch=false $TEST_OPTS --base=origin/develop - name: Test all