-
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.
- Loading branch information
Showing
1 changed file
with
50 additions
and
24 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 |
---|---|---|
@@ -1,37 +1,63 @@ | ||
name: Generate Cypress Report | ||
on: [push] | ||
name: Cypress Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
cypress-test: | ||
name: Run Tests on Chrome Browser | ||
cypress-run: | ||
runs-on: ubuntu-latest | ||
container: cypress/browsers:node18.12.0-chrome107 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Install cypress and verify | ||
run: | | ||
npm ci | ||
$(npm bin)/cypress verify | ||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Run Cypress tests | ||
run: npm run cy:test | ||
continue-on-error: true | ||
|
||
- name: Copy test execution videos and screenshots | ||
run: | | ||
mkdir public | ||
cp -r cypress/videos public/videos | ||
cp -r cypress/screenshots public/screenshots | ||
run: npm run scripts | ||
env: | ||
CI: true | ||
|
||
- name: Merge test reports | ||
- name: Merge Test Reports | ||
run: npm run combine-reports | ||
|
||
- name: Generate HTML report | ||
- name: Generate HTML Report | ||
run: npm run generate-report | ||
|
||
- name: Deploy report page to GitHub Page | ||
uses: peaceiris/actions-gh-pages@v3 | ||
- name: Upload Cypress Screenshots | ||
if: failure() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: cypress-screenshots | ||
path: cypress/screenshots | ||
|
||
- name: Upload Cypress Videos | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: cypress-videos | ||
path: cypress/videos | ||
|
||
- name: Upload Cypress Report | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: cypress-report | ||
path: cypress/reports | ||
|
||
- name: Upload HTML Report | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./public | ||
name: cypress-html-report | ||
path: cypress/reports/mochawesome.html |