|
9 | 9 | - 'release/*' |
10 | 10 | workflow_dispatch: |
11 | 11 |
|
| 12 | +concurrency: |
| 13 | + group: 'workflow-${{ github.workflow }}-${{ github.ref }}' |
| 14 | + cancel-in-progress: true |
| 15 | + |
12 | 16 | jobs: |
13 | 17 | build-and-check: |
| 18 | + continue-on-error: true |
14 | 19 | runs-on: ubuntu-latest |
15 | 20 | steps: |
16 | | - - uses: actions/checkout@v4 |
| 21 | + - name: Checkout |
| 22 | + uses: actions/checkout@v4 |
17 | 23 | with: |
18 | 24 | fetch-depth: 0 |
19 | 25 | persist-credentials: false |
20 | 26 | - uses: ./.github/actions/pnpm-setup |
21 | | - |
22 | 27 | - name: Build |
23 | 28 | run: pnpm -r build |
24 | | - |
25 | | - - name: Unused |
26 | | - run: pnpm -r --parallel unused |
27 | | - |
28 | | - - name: Lint |
29 | | - run: pnpm -r --parallel lint |
30 | | - |
31 | 29 | - name: Format |
32 | 30 | run: pnpm -r --parallel format |
| 31 | + - name: Lint |
| 32 | + run: pnpm -r --parallel lint |
| 33 | + - name: Unit Tests |
| 34 | + run: pnpm -r --parallel test:unit |
| 35 | + - name: Unused |
| 36 | + run: pnpm -r --parallel unused |
33 | 37 |
|
34 | | - test: |
| 38 | + e2e-tests: |
| 39 | + continue-on-error: true |
35 | 40 | runs-on: ubuntu-latest |
36 | 41 | steps: |
37 | | - - uses: actions/checkout@v4 |
| 42 | + - name: Checkout |
| 43 | + uses: actions/checkout@v4 |
38 | 44 | with: |
39 | 45 | fetch-depth: 0 |
40 | 46 | persist-credentials: false |
41 | 47 | - uses: ./.github/actions/pnpm-setup |
42 | | - |
43 | | - - name: Install Playwright Browsers |
44 | | - run: pnpm --filter @public-ui/components exec playwright install --with-deps |
45 | | - |
46 | | - - name: Build |
47 | | - run: pnpm --filter @public-ui/sample-react^... build |
48 | | - |
49 | | - - name: Unit Tests |
50 | | - run: pnpm -r test:unit |
51 | | - |
52 | | - # Tests in sample app are currently failing and hence disabled. |
53 | | - # Remove `--filter @public-ui/components` after tests have been fixed in #7003. |
| 48 | + # Tests in sample app are currently failing and hence disabled. |
| 49 | + # Remove `--filter @public-ui/components` after tests have been fixed in #7003. |
54 | 50 | - name: E2E Test |
55 | 51 | run: pnpm --filter @public-ui/components test:e2e |
56 | | - |
57 | | - - uses: actions/upload-artifact@v4 |
| 52 | + - uses: ./.github/actions/upload-reports |
58 | 53 | if: failure() |
59 | | - name: Upload test reports |
60 | 54 | with: |
61 | | - name: reports |
62 | | - path: | |
63 | | - packages/themes/**/test-results/**/*.png |
64 | | - packages/test-tag-name-transformer/test-results/**/*.png |
65 | | - packages/components/playwright-report/ |
66 | | - !**/node_modules |
| 55 | + name: report-e2e |
67 | 56 |
|
68 | | - test-visual: |
69 | | - runs-on: ubuntu-latest |
| 57 | + visual-tests: |
| 58 | + continue-on-error: true |
70 | 59 | strategy: |
71 | 60 | matrix: |
72 | | - package: ['@public-ui/test-tag-name-transformer', '@public-ui/theme-default', '@public-ui/theme-bwst'] |
| 61 | + package: ['test-tag-name-transformer', 'theme-default', 'theme-bwst'] |
| 62 | + runs-on: ubuntu-latest |
73 | 63 | steps: |
74 | | - - uses: actions/checkout@v4 |
| 64 | + - name: Checkout |
| 65 | + uses: actions/checkout@v4 |
75 | 66 | with: |
76 | 67 | fetch-depth: 0 |
77 | 68 | persist-credentials: false |
78 | 69 | - uses: ./.github/actions/pnpm-setup |
79 | | - |
80 | | - - name: Install Playwright Browsers |
81 | | - run: pnpm --filter @public-ui/components exec playwright install --with-deps |
82 | | - |
83 | 70 | - name: Build |
84 | | - run: pnpm -r build |
85 | | - |
| 71 | + run: pnpm --filter @public-ui/sample-react^... build |
86 | 72 | - name: Visual Tests |
87 | | - run: pnpm --filter=${{ matrix.package }} test:visual |
88 | | - |
89 | | - - uses: actions/upload-artifact@v4 |
| 73 | + run: pnpm --filter=@public-ui/${{ matrix.package }} test |
| 74 | + - uses: ./.github/actions/upload-reports |
90 | 75 | if: failure() |
91 | | - name: Upload test reports |
92 | 76 | with: |
93 | | - name: reports |
94 | | - path: | |
95 | | - packages/themes/**/test-results/**/*.png |
96 | | - packages/test-tag-name-transformer/test-results/**/*.png |
97 | | - packages/components/playwright-report/ |
98 | | - !**/node_modules |
| 77 | + name: report-${{ matrix.package }} |
| 78 | + |
| 79 | + check-results: |
| 80 | + runs-on: ubuntu-latest |
| 81 | + needs: [build-and-check, e2e-tests, visual-tests] |
| 82 | + if: always() |
| 83 | + steps: |
| 84 | + - name: Fail if any job failed |
| 85 | + run: | |
| 86 | + if [[ "${{ needs.build-and-check.result }}" == "failure" || \ |
| 87 | + "${{ needs.e2e-tests.result }}" == "failure" || \ |
| 88 | + "${{ needs.visual-tests.result }}" == "failure" ]]; then |
| 89 | + echo "At least one job failed" |
| 90 | + exit 1 |
| 91 | + fi |
0 commit comments