diff --git a/.github/workflows/daily-ci-cron.yml b/.github/workflows/daily-ci-cron.yml new file mode 100644 index 0000000000..8fce62a62f --- /dev/null +++ b/.github/workflows/daily-ci-cron.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..f26a39ae40 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: string + default: 'false' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -26,6 +33,7 @@ env: jobs: lint: + if: ${{ inputs.cron-run == 'false' || inputs.cron-run == '' }} 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' || inputs.cron-run == '' }} + 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]