-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): attempt to run parallel tests for mobile and desktop viewp…
…orts
- Loading branch information
Showing
4 changed files
with
205 additions
and
12 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
name: Playwright Tests | ||
|
||
on: | ||
pull_request: | ||
paths-ignore: | ||
- ".github/workflows/**" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
runs-on: macos-14 | ||
strategy: | ||
matrix: | ||
project: [desktop-chrome, mobile-chrome, mobile-safari] | ||
steps: | ||
- name: Checkout Uplink Web directory | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: Satellite-im/UplinkWeb | ||
|
||
- name: Checkout Automated Tests directory | ||
uses: actions/checkout@v4 | ||
with: | ||
path: automated-tests | ||
|
||
- name: Setup Node.js for Uplink Web | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Install dependencies for Uplink Web | ||
run: npm install | ||
|
||
- name: Install dependencies for Testing Repo | ||
working-directory: automated-tests | ||
run: npm install | ||
|
||
- name: Install Playwright Browsers | ||
working-directory: automated-tests | ||
run: npx playwright install --with-deps | ||
|
||
- name: Run server for Uplink Web | ||
run: npm run dev & | ||
|
||
- name: Run Playwright tests for Desktop | ||
if: matrix.project == 'desktop-chrome' | ||
working-directory: automated-tests | ||
run: | | ||
PLAYWRIGHT_JSON_OUTPUT_NAME=report.json npx playwright test --project=${{ matrix.project }} | ||
- name: Run Playwright tests for Mobile Chrome and Safari (Single Test File) | ||
if: matrix.project == 'mobile-chrome' || matrix.project == 'mobile-safari' | ||
working-directory: automated-tests | ||
run: | | ||
PLAYWRIGHT_JSON_OUTPUT_NAME=report.json npx playwright test ./automated-tests/playwright/specs/07-settings-profile.spec.ts --project=${{ matrix.project }} | ||
- name: Upload Playwright report | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: playwright-report-${{ matrix.project }} | ||
path: automated-tests/playwright-report/ | ||
|
||
- name: Upload Allure results | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: allure-results-${{ matrix.project }} | ||
path: automated-tests/allure-results/ | ||
|
||
- name: Add label if any of build jobs failed | ||
if: failure() | ||
uses: buildsville/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
labels: | | ||
Failed Automated Test | ||
type: add | ||
|
||
merge-reports: | ||
runs-on: ubuntu-latest | ||
needs: test | ||
steps: | ||
- name: Download Playwright reports | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: playwright-report-* | ||
path: ./playwright-reports/ | ||
|
||
- name: Download Allure results | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: allure-results-* | ||
path: ./allure-results/ | ||
|
||
- name: Generate Allure report | ||
run: | | ||
npx allure generate ./allure-results --clean -o allure-report | ||
- name: Generate Playwright HTML report | ||
run: | | ||
npx playwright show-report ./playwright-reports | ||
- name: Upload Allure report to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v4 | ||
with: | ||
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} | ||
publish_branch: gh-pages | ||
publish_dir: allure-report | ||
|
||
- name: Comment PR with Test Results Summary | ||
if: github.event_name == 'pull_request' | ||
uses: mshick/add-pr-comment@v2 | ||
with: | ||
message: | | ||
Playwright test execution is complete! | ||
- Playwright report: [here](https://github.io/playwright-report) | ||
- Allure report: [here](https://your-gh-pages-url) | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
finalize-label: | ||
needs: [test, merge-reports] | ||
runs-on: ubuntu-latest | ||
permissions: | ||
checks: write | ||
pull-requests: write | ||
contents: write | ||
issues: read | ||
|
||
steps: | ||
- name: Remove label if all tests succeeded | ||
if: success() | ||
uses: buildsville/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
labels: | | ||
Failed Automated Test | ||
type: remove |
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
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
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