Skip to content

OZ-365: Publish GitHub Actions report for E2E tests status to Slack. #397

OZ-365: Publish GitHub Actions report for E2E tests status to Slack.

OZ-365: Publish GitHub Actions report for E2E tests status to Slack. #397

Workflow file for this run

name: Ozone E2E Tests
on:
schedule:
- cron: '0 0 * * 1,3,5'
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
testOnPR:
if: ${{ github.event_name == 'pull_request' }}
timeout-minutes: 40
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Cache dependencies
id: cache
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn install
- name: Install Playwright Browsers
run: npx playwright install chromium --with-deps
- name: Run E2E tests
run: npm run e2eTests
- name: Upload Report
uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
testOnPush:
if: ${{ github.event_name == 'push' }}
timeout-minutes: 40
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Cache dependencies
id: cache
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn install
- name: Install Playwright Browsers
run: npx playwright install chromium --with-deps
- name: Run E2E tests
id: jobStatusPretty
run: |
npm run e2eTests
if [[ ${{ job.status }} == "success" ]]; then
jobStatusPretty="✅ Passing"
else
jobStatusPretty="❌ Failing"
fi
echo "jobStatusPretty=$jobStatusPretty" >> "$GITHUB_ENV"
- name: Notify Slack
id: slack
uses: slackapi/[email protected]
with:
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*QA status for ${{ github.repository }}*: ${{ env.jobStatusPretty }}"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
- name: Upload Report
uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30