feat(kit): IconBadge
add new directive
#4085
Workflow file for this run
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: ⚙️ Playwright E2E testing | |
on: | |
pull_request: | |
jobs: | |
build-demo: | |
if: ${{ !contains(github.head_ref , 'release/') }} | |
name: Build demo | |
runs-on: ubuntu-latest | |
steps: | |
- uses: taiga-family/ci/actions/setup/checkout@v1.67.2 | |
with: | |
fetch-depth: 10 | |
- uses: taiga-family/ci/actions/setup/variables@v1.67.2 | |
- uses: taiga-family/ci/actions/run/rebase@v1.67.2 | |
continue-on-error: true | |
- uses: taiga-family/ci/actions/setup/node@v1.67.2 | |
- name: Building demo-app of git-branch without cache | |
run: npx nx build demo | |
- name: Upload cache / ${{ env.CACHE_DIST_KEY }} | |
uses: actions/cache/save@v4.0.2 | |
with: | |
path: dist/demo | |
key: ${{ env.CACHE_DIST_KEY }} | |
playwright: | |
if: ${{ !contains(github.head_ref , 'release/') }} | |
runs-on: ubuntu-latest | |
needs: [build-demo] | |
strategy: | |
fail-fast: false | |
matrix: | |
shardIndex: [1, 2, 3, 4, 5, 6, 7, 8, 9] | |
shardTotal: [9] | |
name: playwright / (${{ matrix.shardIndex }} of ${{ matrix.shardTotal }}) | |
steps: | |
- uses: taiga-family/ci/actions/setup/checkout@v1.67.2 | |
- uses: taiga-family/ci/actions/setup/variables@v1.67.2 | |
- uses: taiga-family/ci/actions/setup/node@v1.67.2 | |
- name: Install Playwright Browsers | |
run: | | |
npx envinfo --preset playwright | |
npx playwright install --with-deps chromium | |
- name: Download cache / ${{ env.CACHE_DIST_KEY }} | |
uses: actions/cache/restore@v4.0.2 | |
with: | |
path: dist/demo | |
key: ${{ env.CACHE_DIST_KEY }} | |
- name: Serve ${{ env.DIST }} in background | |
run: npx nx serve-compiled demo --path ${{ env.DIST }} --port ${{ env.NG_SERVER_PORT }} | |
- name: Run screenshot tests on ${{ env.DIST }} | |
run: npx nx e2e demo-playwright -- --update-snapshots --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} | |
- name: Clean up resources | |
run: npx kill-port --port ${{ env.NG_SERVER_PORT }} | |
- name: Download ${{ env.DIST_NEXT }} for serve locally | |
run: | | |
git clone \ | |
--depth 1 \ | |
--branch snapshots/demo/next/${{ github.base_ref }} \ | |
https://github.com/${{ github.repository }}.git ${{ env.DIST_NEXT }} | |
- name: Serve ${{ env.DIST_NEXT }} in background | |
run: npx nx serve-compiled demo --path ${{ env.DIST_NEXT }} --port ${{ env.NG_SERVER_PORT }} | |
- name: Run screenshot tests on ${{ env.DIST_NEXT }} | |
continue-on-error: true | |
run: npx nx e2e demo-playwright --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} | |
- name: Clean up resources | |
run: npx kill-port --port ${{ env.NG_SERVER_PORT }} | |
- name: Combine images to get diff reports | |
run: | | |
npm install canvas | |
npx ts-node ./scripts/combine-playwright-failed-screenshots.ts | |
- name: Debug output | |
continue-on-error: true | |
run: tree ${{ env.PLAYWRIGHT_SNAPSHOTS_PATH }} | |
- name: Upload artifacts / ${{ env.PLAYWRIGHT_SNAPSHOTS_ARTIFACTS_KEY }} | |
uses: actions/upload-artifact@v4.3.6 | |
with: | |
path: | | |
./projects/demo-playwright/tests-results/**/*.diff.png | |
!./projects/demo-playwright/tests-results/**/*-retry*/*.diff.png | |
name: '${{ env.PLAYWRIGHT_SNAPSHOTS_ARTIFACTS_KEY }}_${{ matrix.shardIndex }}' | |
if-no-files-found: ignore | |
compression-level: 0 | |
retention-days: 1 | |
# workaround for status checks -- check this one job instead of each individual E2E job in the matrix | |
# see https://github.com/orgs/community/discussions/9141#discussioncomment-2296809 | |
playwright-composite-result: | |
name: Playwright E2E Tests matrix result | |
if: ${{ always() }} | |
needs: | |
- playwright | |
runs-on: ubuntu-latest | |
steps: | |
- run: | | |
result="${{ needs.playwright.result }}" | |
# mark as successful even if skipped | |
if [[ $result == "success" || $result == "skipped" ]]; then | |
exit 0 | |
else | |
exit 1 | |
fi | |
result: | |
if: ${{ !contains(github.head_ref , 'release/') }} | |
name: E2E result | |
needs: [playwright] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: taiga-family/ci/actions/setup/checkout@v1.67.2 | |
- uses: taiga-family/ci/actions/setup/variables@v1.67.2 | |
- name: Download artifacts / ${{ env.PLAYWRIGHT_SNAPSHOTS_ARTIFACTS_KEY }} | |
continue-on-error: true | |
uses: actions/download-artifact@v4.1.8 | |
with: | |
path: ./total/playwright | |
pattern: ${{ env.PLAYWRIGHT_SNAPSHOTS_ARTIFACTS_KEY }}_* | |
merge-multiple: true | |
- run: ls -R ./total/playwright || echo "not found" | |
- name: Check if diff-output exists | |
id: diff_checker | |
run: | | |
echo "diff_exist=$(find ./total -regex '.*diff\.png$' | wc -l | sed -e 's/^[[:space:]]*//')" >> $GITHUB_OUTPUT | |
- name: Fall with an error if diff-output exists | |
if: ${{ steps.diff_checker.outputs.diff_exist != '0' }} | |
run: | | |
find ./total -regex '.*diff\.png$' -exec echo "{}" \; | |
exit 1 | |
concurrency: | |
group: e2e-playwright-${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true |