diff --git a/.github/actions/scheduled-job-slack-notifications/action.yml b/.github/actions/scheduled-job-slack-notifications/action.yml new file mode 100644 index 0000000000..347e1c75c5 --- /dev/null +++ b/.github/actions/scheduled-job-slack-notifications/action.yml @@ -0,0 +1,22 @@ +name: 'Slack Notification for scheduled job' +description: 'Send a Slack message based on job status' + +runs: + using: "composite" + steps: + - name: Notify Slack on Scheduled Job Success + if: job.status == 'success' && github.event_name == 'schedule' + uses: slackapi/slack-github-action@v1.26.0 + env: + SLACK_BOT_TOKEN: ${{ env.SLACK_BOT_TOKEN }} + with: + channel-id: ${{ env.WEEKLY_CI_SLACK_CHANNEL_ID }} + slack-message: "✅Scheduled job *${{github.job}}* on the *${{ github.repository }}* repository succeeded." + - name: Notify Slack on Scheduled Job Failure + if: job.status == 'failure' && github.event_name == 'schedule' + uses: slackapi/slack-github-action@v1.26.0 + env: + SLACK_BOT_TOKEN: ${{ env.SLACK_BOT_TOKEN }} + with: + channel-id: ${{ env.WEEKLY_CI_SLACK_CHANNEL_ID }} + slack-message: "❌Scheduled job *${{github.job}}* on the *${{ github.repository }}* repository failed. Manual intervention is required! \n*Details*: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f3da2df84..f5da88748f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,10 +3,13 @@ name: SUITE-CI on: pull_request: types: [ labeled, unlabeled, synchronize ] - push: - branches: - - master workflow_dispatch: + schedule: + - cron: '0 0 * * 0' + +env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + WEEKLY_CI_SLACK_CHANNEL_ID: ${{ secrets.WEEKLY_CI_SLACK_CHANNEL_ID }} concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -17,6 +20,7 @@ jobs: if: > contains(github.event.pull_request.labels.*.name, 'run-static-ci') || contains(github.event.pull_request.labels.*.name, 'run-latest-ci') + || (github.event_name == 'schedule' && github.ref == 'refs/heads/master') name: "CS, ArchSniffer, PHPStan, Evaluator" runs-on: ubuntu-20.04 strategy: @@ -144,10 +148,15 @@ jobs: - name: Run Evaluator run: vendor/bin/evaluator evaluate + - name: Slack Notification for scheduled job + uses: ./.github/actions/scheduled-job-slack-notifications + if: always() + js-validation: if: > contains(github.event.pull_request.labels.*.name, 'run-npm-ci') || contains(github.event.pull_request.labels.*.name, 'run-latest-ci') + || (github.event_name == 'schedule' && github.ref == 'refs/heads/master') name: "NPM validation" runs-on: ubuntu-22.04 strategy: @@ -180,9 +189,15 @@ jobs: - name: Front-end MP Unit Tests run: npm run mp:test - + + - name: Slack Notification for scheduled job + uses: ./.github/actions/scheduled-job-slack-notifications + if: always() + php-83-mariadb-glue-alpine-dynamic-store-off: - if: contains(github.event.pull_request.labels.*.name, 'run-compatibility-ci') + if: > + contains(github.event.pull_request.labels.*.name, 'run-compatibility-ci') + || (github.event_name == 'schedule' && github.ref == 'refs/heads/master') name: "PHP 8.3 / MariaDB / Glue / Alpine / Dynamic Store OFF" runs-on: ubuntu-20.04 env: @@ -208,12 +223,17 @@ jobs: docker/sdk testing console queue:worker:start --stop-when-empty docker/sdk testing codecept run -c codeception.api.yml + - name: Slack Notification for scheduled job + uses: ./.github/actions/scheduled-job-slack-notifications + if: always() + php-83-mariadb-glue-alpine: name: "PHP 8.3 / MariaDB / Glue / Alpine" if: > !contains(github.event.pull_request.head.ref, 'hackathon') && (contains(github.event.pull_request.labels.*.name, 'run-api-ci') - || contains(github.event.pull_request.labels.*.name, 'run-latest-ci')) + || contains(github.event.pull_request.labels.*.name, 'run-latest-ci')) + || (github.event_name == 'schedule' && github.ref == 'refs/heads/master') runs-on: ubuntu-22.04 env: PROGRESS_TYPE: plain @@ -240,11 +260,16 @@ jobs: docker/sdk testing console queue:worker:start --stop-when-empty docker/sdk testing codecept run -c codeception.api.yml + - name: Slack Notification for scheduled job + uses: ./.github/actions/scheduled-job-slack-notifications + if: always() + php-83-mariadb-acceptance-alpine-dynamic-store-off: name: "PHP 8.3 / MariaDB / Acceptance / Alpine / Dynamic Store OFF" if: > !contains(github.event.pull_request.head.ref, 'hackathon') && contains(github.event.pull_request.labels.*.name, 'run-compatibility-ci') + || (github.event_name == 'schedule' && github.ref == 'refs/heads/master') runs-on: ubuntu-20.04 env: PROGRESS_TYPE: plain @@ -268,12 +293,17 @@ jobs: docker/sdk testing console queue:worker:start --stop-when-empty docker/sdk testing codecept run -c codeception.acceptance.yml + - name: Slack Notification for scheduled job + uses: ./.github/actions/scheduled-job-slack-notifications + if: always() + php-83-mariadb-acceptance-alpine: name: "PHP 8.3 / MariaDB / Acceptance / Alpine" if: > !contains(github.event.pull_request.head.ref, 'hackathon') && (contains(github.event.pull_request.labels.*.name, 'run-ui-ci') - || contains(github.event.pull_request.labels.*.name, 'run-latest-ci')) + || contains(github.event.pull_request.labels.*.name, 'run-latest-ci')) + || (github.event_name == 'schedule' && github.ref == 'refs/heads/master') runs-on: ubuntu-20.04 env: PROGRESS_TYPE: plain @@ -299,10 +329,15 @@ jobs: docker/sdk testing console queue:worker:start --stop-when-empty docker/sdk testing codecept run -c codeception.acceptance.yml + - name: Slack Notification for scheduled job + uses: ./.github/actions/scheduled-job-slack-notifications + if: always() + php-83-mariadb-functional-alpine-dynamic-store-off: if: > !contains(github.event.pull_request.head.ref, 'hackathon') && contains(github.event.pull_request.labels.*.name, 'run-compatibility-ci') + || (github.event_name == 'schedule' && github.ref == 'refs/heads/master') runs-on: ubuntu-20.04 env: PROGRESS_TYPE: plain @@ -325,10 +360,15 @@ jobs: docker/sdk cli composer dump-autoload -o -a --apcu docker/sdk testing codecept run -c codeception.functional.yml + - name: Slack Notification for scheduled job + uses: ./.github/actions/scheduled-job-slack-notifications + if: always() + php-83-mariadb-functional-alpine: if: > contains(github.event.pull_request.labels.*.name, 'run-functional-ci') - || contains(github.event.pull_request.labels.*.name, 'run-latest-ci') + || contains(github.event.pull_request.labels.*.name, 'run-latest-ci') + || (github.event_name == 'schedule' && github.ref == 'refs/heads/master') name: "PHP 8.3 / MariaDB / Functional / Alpine" runs-on: ubuntu-20.04 env: @@ -354,10 +394,15 @@ jobs: docker/sdk cli composer dump-autoload -o -a --apcu docker/sdk testing codecept run -c codeception.functional.yml + - name: Slack Notification for scheduled job + uses: ./.github/actions/scheduled-job-slack-notifications + if: always() + php-82-mariadb-glue-alpine-dynamic-store-off: if: > !contains(github.event.pull_request.head.ref, 'hackathon') && contains(github.event.pull_request.labels.*.name, 'run-compatibility-ci') + || (github.event_name == 'schedule' && github.ref == 'refs/heads/master') name: "PHP 8.2 / MariaDB / Glue / Alpine / Dynamic Store OFF" runs-on: ubuntu-20.04 env: @@ -383,8 +428,14 @@ jobs: docker/sdk testing console queue:worker:start --stop-when-empty docker/sdk testing codecept run -c codeception.api.yml + - name: Slack Notification for scheduled job + uses: ./.github/actions/scheduled-job-slack-notifications + if: always() + php-82-mariadb-glue-alpine: - if: contains(github.event.pull_request.labels.*.name, 'run-compatibility-ci') + if: > + contains(github.event.pull_request.labels.*.name, 'run-compatibility-ci') + || (github.event_name == 'schedule' && github.ref == 'refs/heads/master') name: "PHP 8.2 / MariaDB / Glue / Alpine" runs-on: ubuntu-20.04 env: @@ -412,8 +463,14 @@ jobs: docker/sdk testing console queue:worker:start --stop-when-empty docker/sdk testing codecept run -c codeception.api.yml + - name: Slack Notification for scheduled job + uses: ./.github/actions/scheduled-job-slack-notifications + if: always() + php-82-postgresql-acceptance-alpine-dynamic-store-off: - if: contains(github.event.pull_request.labels.*.name, 'run-compatibility-ci') + if: > + contains(github.event.pull_request.labels.*.name, 'run-compatibility-ci') + || (github.event_name == 'schedule' && github.ref == 'refs/heads/master') name: "PHP 8.2 / PostgreSQL / Acceptance / Alpine / Dynamic Store OFF" runs-on: ubuntu-20.04 env: @@ -438,10 +495,15 @@ jobs: docker/sdk testing console queue:worker:start --stop-when-empty docker/sdk testing codecept run -c codeception.acceptance.yml + - name: Slack Notification for scheduled job + uses: ./.github/actions/scheduled-job-slack-notifications + if: always() + php-82-postgresql-acceptance-alpine: if: > !contains(github.event.pull_request.head.ref, 'hackathon') && contains(github.event.pull_request.labels.*.name, 'run-compatibility-ci') + || (github.event_name == 'schedule' && github.ref == 'refs/heads/master') name: "PHP 8.2 / PostgreSQL / Acceptance / Alpine" runs-on: ubuntu-20.04 env: @@ -468,10 +530,15 @@ jobs: docker/sdk testing console queue:worker:start --stop-when-empty docker/sdk testing codecept run -c codeception.acceptance.yml + - name: Slack Notification for scheduled job + uses: ./.github/actions/scheduled-job-slack-notifications + if: always() + php-82-postgresql-functional-alpine-dynamic-store-off: if: > !contains(github.event.pull_request.head.ref, 'hackathon') && contains(github.event.pull_request.labels.*.name, 'run-compatibility-ci') + || (github.event_name == 'schedule' && github.ref == 'refs/heads/master') name: "PHP 8.2 / PostgreSQL / Functional / Alpine / Dynamic Store OFF" runs-on: ubuntu-20.04 env: @@ -496,10 +563,15 @@ jobs: docker/sdk testing console queue:worker:start --stop-when-empty docker/sdk testing codecept run -c codeception.functional.yml + - name: Slack Notification for scheduled job + uses: ./.github/actions/scheduled-job-slack-notifications + if: always() + php-82-postgresql-functional-alpine: if: > !contains(github.event.pull_request.head.ref, 'hackathon') && contains(github.event.pull_request.labels.*.name, 'run-compatibility-ci') + || (github.event_name == 'schedule' && github.ref == 'refs/heads/master') name: "PHP 8.2 / PostgreSQL / Functional / Alpine" runs-on: ubuntu-20.04 env: @@ -526,8 +598,14 @@ jobs: docker/sdk testing console queue:worker:start --stop-when-empty docker/sdk testing codecept run -c codeception.functional.yml + - name: Slack Notification for scheduled job + uses: ./.github/actions/scheduled-job-slack-notifications + if: always() + php-82-mariadb-acceptance-alpine-dynamic-store-off: - if: contains(github.event.pull_request.labels.*.name, 'run-compatibility-ci') + if: > + contains(github.event.pull_request.labels.*.name, 'run-compatibility-ci') + || (github.event_name == 'schedule' && github.ref == 'refs/heads/master') name: "PHP 8.2 / MariaDB / Acceptance / Alpine / Dynamic Store OFF" runs-on: ubuntu-20.04 env: @@ -552,10 +630,15 @@ jobs: docker/sdk testing console queue:worker:start --stop-when-empty docker/sdk testing codecept run -c codeception.acceptance.yml + - name: Slack Notification for scheduled job + uses: ./.github/actions/scheduled-job-slack-notifications + if: always() + php-82-mariadb-acceptance-alpine: if: > !contains(github.event.pull_request.head.ref, 'hackathon') && contains(github.event.pull_request.labels.*.name, 'run-compatibility-ci') + || (github.event_name == 'schedule' && github.ref == 'refs/heads/master') name: "PHP 8.2 / MariaDB / Acceptance / Alpine" runs-on: ubuntu-20.04 env: @@ -582,8 +665,14 @@ jobs: docker/sdk testing console queue:worker:start --stop-when-empty docker/sdk testing codecept run -c codeception.acceptance.yml + - name: Slack Notification for scheduled job + uses: ./.github/actions/scheduled-job-slack-notifications + if: always() + php-82-mariadb-functional-alpine-dynamic-store-off: - if: contains(github.event.pull_request.labels.*.name, 'run-compatibility-ci') + if: > + contains(github.event.pull_request.labels.*.name, 'run-compatibility-ci') + || (github.event_name == 'schedule' && github.ref == 'refs/heads/master') name: "PHP 8.2 / MariaDB / Functional / Alpine / Dynamic Store OFF" runs-on: ubuntu-20.04 env: @@ -607,10 +696,15 @@ jobs: docker/sdk cli composer dump-autoload -o -a --apcu docker/sdk testing codecept run -c codeception.functional.yml + - name: Slack Notification for scheduled job + uses: ./.github/actions/scheduled-job-slack-notifications + if: always() + php-82-mariadb-functional-alpine: if: > !contains(github.event.pull_request.head.ref, 'hackathon') && contains(github.event.pull_request.labels.*.name, 'run-compatibility-ci') + || (github.event_name == 'schedule' && github.ref == 'refs/heads/master') name: "PHP 8.2 / MariaDB / Functional / Alpine" runs-on: ubuntu-20.04 env: @@ -636,10 +730,15 @@ jobs: docker/sdk cli composer dump-autoload -o -a --apcu docker/sdk testing codecept run -c codeception.functional.yml + - name: Slack Notification for scheduled job + uses: ./.github/actions/scheduled-job-slack-notifications + if: always() + php-82-postgres-functional-debian-dynamic-store-off: if: > !contains(github.event.pull_request.head.ref, 'hackathon') && contains(github.event.pull_request.labels.*.name, 'run-compatibility-ci') + || (github.event_name == 'schedule' && github.ref == 'refs/heads/master') name: "PHP 8.2 / PostgreSQL / Functional / Debian / Dynamic Store OFF" runs-on: ubuntu-20.04 env: @@ -663,8 +762,14 @@ jobs: docker/sdk cli composer dump-autoload -o -a --apcu docker/sdk testing codecept run -c codeception.functional.yml + - name: Slack Notification for scheduled job + uses: ./.github/actions/scheduled-job-slack-notifications + if: always() + php-82-postgres-functional-debian: - if: contains(github.event.pull_request.labels.*.name, 'run-compatibility-ci') + if: > + contains(github.event.pull_request.labels.*.name, 'run-compatibility-ci') + || (github.event_name == 'schedule' && github.ref == 'refs/heads/master') name: "PHP 8.2 / PostgreSQL / Functional / Debian" runs-on: ubuntu-20.04 env: @@ -690,6 +795,10 @@ jobs: docker/sdk cli composer dump-autoload -o -a --apcu docker/sdk testing codecept run -c codeception.functional.yml + - name: Slack Notification for scheduled job + uses: ./.github/actions/scheduled-job-slack-notifications + if: always() + php-82-frontend-and-assets-alpine: name: "PHP 8.2 / Frontend & Assets / Alpine" runs-on: ubuntu-20.04 @@ -697,6 +806,7 @@ jobs: !contains(github.event.pull_request.head.ref, 'hackathon') && (contains(github.event.pull_request.labels.*.name, 'run-functional-ci') || contains(github.event.pull_request.labels.*.name, 'run-latest-ci')) + || (github.event_name == 'schedule' && github.ref == 'refs/heads/master') env: PROGRESS_TYPE: plain SPRYKER_PLATFORM_IMAGE: spryker/php:8.2 @@ -721,10 +831,15 @@ jobs: docker run -i --rm --entrypoint='' spryker_demo_frontend:1.0-frontend ls -al /data/public/Yves/assets/myhash docker run -i --rm --entrypoint='' spryker_demo_frontend:1.0-frontend ls -al /data/public/Zed/assets/ + - name: Slack Notification for scheduled job + uses: ./.github/actions/scheduled-job-slack-notifications + if: always() + php-82-lowest: if: > !contains(github.event.pull_request.head.ref, 'hackathon') && contains(github.event.pull_request.labels.*.name, 'run-compatibility-ci') + || (github.event_name == 'schedule' && github.ref == 'refs/heads/master') name: "PHP 8.2 / Prefer Lowest" runs-on: ubuntu-20.04 @@ -746,10 +861,15 @@ jobs: run: | composer lowest + - name: Slack Notification for scheduled job + uses: ./.github/actions/scheduled-job-slack-notifications + if: always() + docker-alpine-php-8-2-mariadb-robot-dynamic-store-off: if: > !contains(github.event.pull_request.head.ref, 'hackathon') && contains(github.event.pull_request.labels.*.name, 'run-compatibility-ci') + || (github.event_name == 'schedule' && github.ref == 'refs/heads/master') name: "Docker / Alpine / PHP 8.2 / MariaDB / Robot / API / Dynamic Store OFF" runs-on: ubuntu-20.04 env: @@ -799,10 +919,15 @@ jobs: run: | AWS_DEFAULT_REGION=${{env.ROBOT_TESTS_ARTIFACTS_BUCKET_REGION}} AWS_ACCESS_KEY_ID=${{ secrets.ROBOT_TESTS_ARTIFACTS_KEY }} AWS_SECRET_ACCESS_KEY=${{ secrets.ROBOT_TESTS_ARTIFACTS_SECRET }} aws s3 cp robotframework-tests/results/log.html s3://${{vars.ROBOT_TESTS_ARTIFACTS_BUCKET}}/suite/dms-off/robot-api/${GITHUB_RUN_ID}/PHP8.2MariaDB/log.html + - name: Slack Notification for scheduled job + uses: ./.github/actions/scheduled-job-slack-notifications + if: always() + docker-alpine-php-8-3-postgresql-robot: if: > !contains(github.event.pull_request.head.ref, 'hackathon') && contains(github.event.pull_request.labels.*.name, 'run-compatibility-ci') + || (github.event_name == 'schedule' && github.ref == 'refs/heads/master') name: "Docker / Alpine / PHP 8.3 / PostgreSQL / Robot / API" runs-on: ubuntu-20.04 env: @@ -858,11 +983,16 @@ jobs: run: | AWS_DEFAULT_REGION=${{env.ROBOT_TESTS_ARTIFACTS_BUCKET_REGION}} AWS_ACCESS_KEY_ID=${{ secrets.ROBOT_TESTS_ARTIFACTS_KEY }} AWS_SECRET_ACCESS_KEY=${{ secrets.ROBOT_TESTS_ARTIFACTS_SECRET }} aws s3 cp robotframework-tests/results/log.html s3://${{vars.ROBOT_TESTS_ARTIFACTS_BUCKET}}/suite/dms-on/robot-api/${GITHUB_RUN_ID}/PHP8.3PostgreSQL/log.html + - name: Slack Notification for scheduled job + uses: ./.github/actions/scheduled-job-slack-notifications + if: always() + docker-alpine-php-8-3-mariadb-robot: if: > !contains(github.event.pull_request.head.ref, 'hackathon') && (contains(github.event.pull_request.labels.*.name, 'run-ui-ci') || contains(github.event.pull_request.labels.*.name, 'run-latest-ci')) + || (github.event_name == 'schedule' && github.ref == 'refs/heads/master') name: "Docker / Alpine / PHP 8.3 / MariaDB / Robot / API" runs-on: ubuntu-20.04 env: @@ -918,6 +1048,10 @@ jobs: run: | AWS_DEFAULT_REGION=${{env.ROBOT_TESTS_ARTIFACTS_BUCKET_REGION}} AWS_ACCESS_KEY_ID=${{ secrets.ROBOT_TESTS_ARTIFACTS_KEY }} AWS_SECRET_ACCESS_KEY=${{ secrets.ROBOT_TESTS_ARTIFACTS_SECRET }} aws s3 cp robotframework-tests/results/log.html s3://${{vars.ROBOT_TESTS_ARTIFACTS_BUCKET}}/suite/dms-on/robot-api/${GITHUB_RUN_ID}/PHP8.3MariaDB/log.html + - name: Slack Notification for scheduled job + uses: ./.github/actions/scheduled-job-slack-notifications + if: always() + positive-docker-alpine-php-8-2-mariadb-robot: name: "[Hackathon] Positive / Docker / Alpine / PHP 8.2 / MariaDB / Robot / API" runs-on: ubuntu-20.04