From 07f85b1b730121091a9005bbce3202816171e52a Mon Sep 17 00:00:00 2001 From: Daria Domina Date: Sun, 12 Oct 2025 12:48:44 +0200 Subject: [PATCH 1/3] use composite action for env setup --- .github/actions/setup-playwright/action.yaml | 20 +++++++ .../workflows/auto-simple-suite-reusable.yaml | 58 +++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 .github/actions/setup-playwright/action.yaml create mode 100644 .github/workflows/auto-simple-suite-reusable.yaml diff --git a/.github/actions/setup-playwright/action.yaml b/.github/actions/setup-playwright/action.yaml new file mode 100644 index 0000000..449ab5a --- /dev/null +++ b/.github/actions/setup-playwright/action.yaml @@ -0,0 +1,20 @@ +name: 'Setup Playwright' +description: 'Install Node.js, dependencies and Playwright browsers' + +runs: + using: 'composite' + steps: + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'yarn' + shell: bash + + - name: Install dependencies + run: yarn install + shell: bash + + - name: Install Playwright browsers + run: yarn playwright install chromium + shell: bash \ No newline at end of file diff --git a/.github/workflows/auto-simple-suite-reusable.yaml b/.github/workflows/auto-simple-suite-reusable.yaml new file mode 100644 index 0000000..549c13e --- /dev/null +++ b/.github/workflows/auto-simple-suite-reusable.yaml @@ -0,0 +1,58 @@ +name: Auto run simple suite with reusable setup + +on: + pull_request: + branches: [ main ] + workflow_dispatch: + +jobs: + run-simple-suite: + timeout-minutes: 15 + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Node.js and Playwright + uses: ./.github/actions/setup-playwright/action.yaml + + - name: Run simple suite + run: yarn playwright test --project=chromium --grep @smoke + + - name: Upload test results + if: ${{ !cancelled() }} + uses: actions/upload-artifact@v4 + with: + name: simple-suite-results-${{ github.run_id }} + path: playwright-report/ + retention-days: 7 + + post-slack-notification-started: + runs-on: ubuntu-latest + steps: + - name: Post a start message in a Slack channel + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + run: | + curl -X POST -H 'Content-type: application/json' \ + --data '{"text":"The simple suite pipeline started"}' \ + $SLACK_WEBHOOK_URL + + post-slack-notification-results: + runs-on: ubuntu-latest + needs: run-simple-suite + if: always() + steps: + - name: Post a result message in a Slack channel + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + run: | + if [ "${{ needs.run-simple-suite.result }}" == "success" ]; then + MESSAGE="The simple suite pipeline succeeded" + elif [ "${{ needs.run-simple-suite.result }}" == "failure" ]; then + MESSAGE="The simple suite pipeline failed" + fi + + curl -X POST -H 'Content-type: application/json' \ + --data "{\"text\":\"$MESSAGE\"}" \ + $SLACK_WEBHOOK_URL \ No newline at end of file From 991a8b7e5df4fe5c7fa9f610f5f655b5e84a69a2 Mon Sep 17 00:00:00 2001 From: Daria Domina Date: Sun, 12 Oct 2025 12:53:15 +0200 Subject: [PATCH 2/3] fix the path --- .github/workflows/auto-simple-suite-reusable.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-simple-suite-reusable.yaml b/.github/workflows/auto-simple-suite-reusable.yaml index 549c13e..0bf93b3 100644 --- a/.github/workflows/auto-simple-suite-reusable.yaml +++ b/.github/workflows/auto-simple-suite-reusable.yaml @@ -14,7 +14,7 @@ jobs: uses: actions/checkout@v4 - name: Set up Node.js and Playwright - uses: ./.github/actions/setup-playwright/action.yaml + uses: ./.github/actions/setup-playwright - name: Run simple suite run: yarn playwright test --project=chromium --grep @smoke From 75af4e59b42eec2435e0bea90f696e384451a460 Mon Sep 17 00:00:00 2001 From: Daria Domina Date: Sun, 12 Oct 2025 12:54:36 +0200 Subject: [PATCH 3/3] remove shell --- .github/actions/setup-playwright/action.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/actions/setup-playwright/action.yaml b/.github/actions/setup-playwright/action.yaml index 449ab5a..36e84c3 100644 --- a/.github/actions/setup-playwright/action.yaml +++ b/.github/actions/setup-playwright/action.yaml @@ -9,7 +9,6 @@ runs: with: node-version: '22' cache: 'yarn' - shell: bash - name: Install dependencies run: yarn install