-
Notifications
You must be signed in to change notification settings - Fork 478
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: enable CI for screenshot testing inside Cypress CT
- Loading branch information
1 parent
a965dd5
commit fd349e1
Showing
3 changed files
with
40 additions
and
9 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,21 +1,49 @@ | ||
name: ⚙️ Cypress component testing | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
env: | ||
CYPRESS_BASELINE_REPO: 'baseline' | ||
CYPRESS_RESULTS_FOLDER: 'projects/demo-cypress/tests-results' | ||
CYPRESS_BASELINE_SNAPSHOTS: 'projects/demo-cypress/tests-results/snapshots/baseline' | ||
CYPRESS_SNAPSHOTS_ARTIFACTS_KEY: | ||
'cypress-e2e-artifacts--${{ github.event.pull_request.head.sha || github.sha }}-${{ github.run_id }}-${{ | ||
github.event.number }}' | ||
|
||
jobs: | ||
cypress: | ||
if: ${{ !contains(github.head_ref, 'release/') }} | ||
runs-on: ubuntu-latest | ||
name: Component testing result | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: taiga-family/ci/actions/setup/[email protected] | ||
- uses: taiga-family/ci/actions/setup/[email protected] | ||
- run: npx tsc -p projects/demo-cypress/tsconfig.json | ||
- run: npx nx component-test demo-cypress | ||
- uses: actions/[email protected] | ||
with: | ||
ref: ${{ github.base_ref }} | ||
path: ${{ env.CYPRESS_BASELINE_REPO }} | ||
- uses: taiga-family/ci/actions/setup/[email protected] | ||
- uses: taiga-family/ci/actions/setup/[email protected] | ||
- run: | | ||
cd baseline | ||
npx nx component-test demo-cypress | ||
cd ../ | ||
cp ${{ env.CYPRESS_BASELINE_REPO }}/${{ env.CYPRESS_BASELINE_SNAPSHOTS }} ${{ env.CYPRESS_BASELINE_SNAPSHOTS }} | ||
npx nx component-test demo-cypress | ||
- run: | | ||
npm install canvas | ||
npx ts-node ./scripts/visual-testing/combine-cypress-failed-screenshots.ts | ||
- name: Debug output | ||
continue-on-error: true | ||
run: tree ${{ env.CYPRESS_RESULTS_FOLDER }} -L 1 | ||
|
||
- name: Upload artifacts / ${{ env.CYPRESS_SNAPSHOTS_ARTIFACTS_KEY }} | ||
uses: actions/[email protected] | ||
with: | ||
path: '${{ env.CYPRESS_RESULTS_FOLDER }}/**/*.diff.png' | ||
name: ${{ env.CYPRESS_SNAPSHOTS_ARTIFACTS_KEY }} | ||
if-no-files-found: ignore | ||
compression-level: 0 | ||
retention-days: 1 | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
|
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