fix: refactor test workflow #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run system tests - integration | |
on: | |
workflow_dispatch: | |
inputs: | |
ALLURE_JOB_RUN_ID: | |
type: string | |
description: ALLURE_JOB_RUN_ID service parameter. Leave blank. | |
required: false | |
ALLURE_USERNAME: | |
type: string | |
description: ALLURE_USERNAME service parameter. Leave blank. | |
required: false | |
schedule: | |
- cron: '0 6 * * *' # 9:00 GMT+3 | |
pull_request: | |
# paths: | |
# - 'tests/**' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
CI: true | |
ALLURE_ENDPOINT: https://nova.testops.cloud/ | |
ALLURE_PROJECT_ID: 1 | |
ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }} | |
ALLURE_JOB_RUN_ID: ${{ github.event.inputs.ALLURE_JOB_RUN_ID }} | |
ALLURE_RESULTS: allure-results | |
jobs: | |
system-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: ⚙️ Install dependencies | |
uses: ./.github/workflows/install-pnpm | |
- name: ⚙️ Install test dependencies | |
uses: ./.github/workflows/install-test | |
- name: Run Playwright tests | |
run: allurectl watch -- npx playwright test --grep @fee-test | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
publish_report: | |
name: Publish HTML Report | |
if: success() || needs.system-tests.result == 'failure' | |
needs: [system-tests] | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
env: | |
# Unique URL path for each workflow run attempt | |
HTML_REPORT_URL_PATH: reports/${{ github.ref_name }}/${{ github.run_id }}/${{ github.run_attempt }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Publish test results | |
uses: ./.github/workflows/publish-test-results | |
with: | |
html_report_url_path: ${{ env.HTML_REPORT_URL_PATH }} | |
checkout_token: ${{ secrets.CREATE_TAG_PAT }} | |
- run: | | |
COMMIT_INFO="Commit: [${{ github.sha }}](${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }})" | |
echo "COMMIT_INFO<<EOF" >> $GITHUB_ENV | |
echo "$COMMIT_INFO" >> $GITHUB_ENV | |
echo "EOF" >> $GITHUB_ENV | |
echo "RUN_TYPE_INFO=`🔁 Regression`" >> $GITHUB_ENV | |
shell: bash | |
- name: Set Status | |
shell: bash | |
run: | | |
if [[ "${{ needs.system-tests.result }}" == 'failure' ]]; then | |
echo "STATUS=❌" >> $GITHUB_ENV | |
else | |
echo "STATUS=✅" >> $GITHUB_ENV | |
fi | |
- name: Notify Telegram channel | |
uses: appleboy/telegram-action@master | |
with: | |
to: ${{ secrets.TELEGRAM_TO }} | |
token: ${{ secrets.TELEGRAM_TOKEN }} | |
format: markdown | |
message: | | |
📋 Playwright Test Report Published | |
URL: ${{ env.FULL_HTML_REPORT_URL }} | |
Run type: ${{ env.RUN_TYPE_INFO }} | |
Status: ${{ env.STATUS }} | |
${{ env.COMMIT_INFO }} |