|
20 | 20 | jobs: |
21 | 21 | accessibility: |
22 | 22 | name: Accessibility |
23 | | - runs-on: ubuntu-latest |
| 23 | + runs-on: |
| 24 | + labels: |
| 25 | + - runs-on |
| 26 | + - runner=16cpu-linux-x64 |
| 27 | + - run-id=${{ github.run_id }} |
24 | 28 | steps: |
25 | 29 | - uses: actions/checkout@v4 |
26 | 30 | - uses: ruby/setup-ruby@v1 |
|
42 | 46 | run: bundle exec rake test:accessibility |
43 | 47 | components: |
44 | 48 | name: Components |
45 | | - runs-on: ubuntu-latest |
| 49 | + runs-on: |
| 50 | + labels: |
| 51 | + - runs-on |
| 52 | + - runner=16cpu-linux-x64 |
| 53 | + - run-id=${{ github.run_id }} |
46 | 54 | strategy: |
47 | 55 | fail-fast: false |
48 | 56 | matrix: |
|
90 | 98 | RAILS_VERSION: ${{ matrix.rails_version }} |
91 | 99 | lib: |
92 | 100 | name: Lib |
93 | | - runs-on: ubuntu-latest |
| 101 | + runs-on: |
| 102 | + labels: |
| 103 | + - runs-on |
| 104 | + - runner=16cpu-linux-x64 |
| 105 | + - run-id=${{ github.run_id }} |
94 | 106 | strategy: |
95 | 107 | fail-fast: false |
96 | 108 | matrix: |
@@ -229,60 +241,68 @@ jobs: |
229 | 241 | timeout-minutes: 20 |
230 | 242 | runs-on: ubuntu-latest |
231 | 243 | steps: |
232 | | - - uses: actions/checkout@v4 |
233 | | - - uses: ruby/setup-ruby@v1 |
234 | | - with: |
235 | | - ruby-version: '3.2' |
236 | | - bundler-cache: true |
237 | | - - uses: actions/setup-node@v4 |
238 | | - with: |
239 | | - node-version: 16 |
240 | | - cache: 'npm' |
241 | | - cache-dependency-path: | |
242 | | - package-lock.json |
243 | | - demo/package-lock.json |
244 | | - - name: Build |
245 | | - run: | |
246 | | - npm ci |
247 | | - bundle install |
248 | | - bundle exec rake static:dump |
249 | | - cd demo |
250 | | - npm ci |
251 | | - bundle install |
252 | | - - name: Install Playwright Browsers |
253 | | - run: npx playwright install --with-deps |
254 | | - - name: Run Playwright tests |
255 | | - id: playwright-run |
256 | | - continue-on-error: true |
257 | | - run: npx playwright test --workers 6 |
258 | | - - id: auto-commit |
259 | | - uses: stefanzweifel/git-auto-commit-action@v5 |
260 | | - with: |
261 | | - commit_message: Generating component snapshots |
262 | | - file_pattern: .playwright/screenshots/**/*.png |
263 | | - - name: "Changes detected" |
264 | | - if: steps.auto-commit.outputs.changes_detected == 'true' |
265 | | - uses: phulsechinmay/rewritable-pr-comment@v0.3.0 |
266 | | - with: |
267 | | - message: | |
268 | | - ### ⚠️ Visual differences found |
269 | | - |
270 | | - Our visual comparison tests found UI differences. Please review the differences by viewing the files changed tab to ensure that the changes were intentional. |
271 | | - |
272 | | - [Review visual differences](https://github.com/opf/primer_view_components/pull/${{ github.event.number }}/files?file-filters%5B%5D=.png&show-viewed-files=false) |
273 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
274 | | - COMMENT_IDENTIFIER: 'visual-comparison-diff' |
275 | | - - uses: actions/upload-artifact@v4 |
276 | | - with: |
277 | | - name: playwright-report |
278 | | - path: .playwright/report/ |
279 | | - retention-days: 30 |
280 | | - - name: Failure |
281 | | - if: ${{ steps.auto-commit.outputs.changes_detected == 'true' || steps.playwright-run.outcome == 'failure' }} |
282 | | - run: exit 1 |
| 244 | + - uses: actions/checkout@v4 |
| 245 | + - uses: ruby/setup-ruby@v1 |
| 246 | + with: |
| 247 | + ruby-version: '3.2' |
| 248 | + bundler-cache: true |
| 249 | + - uses: actions/setup-node@v4 |
| 250 | + with: |
| 251 | + node-version: 16 |
| 252 | + cache: 'npm' |
| 253 | + cache-dependency-path: | |
| 254 | + package-lock.json |
| 255 | + demo/package-lock.json |
| 256 | + - name: Build |
| 257 | + run: | |
| 258 | + npm ci |
| 259 | + bundle install |
| 260 | + bundle exec rake static:dump |
| 261 | + cd demo |
| 262 | + npm ci |
| 263 | + bundle install |
| 264 | + - name: Install Overmind |
| 265 | + run: | |
| 266 | + sudo apt-get install tmux |
| 267 | + gem install overmind |
| 268 | + - name: Install Playwright Browsers |
| 269 | + run: npx playwright install --with-deps |
| 270 | + - name: Run Playwright tests |
| 271 | + id: playwright-run |
| 272 | + continue-on-error: true |
| 273 | + run: npx playwright test --workers 6 |
| 274 | + - id: auto-commit |
| 275 | + uses: stefanzweifel/git-auto-commit-action@v5 |
| 276 | + with: |
| 277 | + commit_message: Generating component snapshots |
| 278 | + file_pattern: .playwright/screenshots/**/*.png |
| 279 | + - name: "Changes detected" |
| 280 | + if: steps.auto-commit.outputs.changes_detected == 'true' |
| 281 | + uses: phulsechinmay/rewritable-pr-comment@v0.3.0 |
| 282 | + with: |
| 283 | + message: | |
| 284 | + ### ⚠️ Visual differences found |
| 285 | +
|
| 286 | + Our visual comparison tests found UI differences. Please review the differences by viewing the files changed tab to ensure that the changes were intentional. |
| 287 | +
|
| 288 | + [Review visual differences](https://github.com/opf/primer_view_components/pull/${{ github.event.number }}/files?file-filters%5B%5D=.png&show-viewed-files=false) |
| 289 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 290 | + COMMENT_IDENTIFIER: 'visual-comparison-diff' |
| 291 | + - uses: actions/upload-artifact@v4 |
| 292 | + with: |
| 293 | + name: playwright-report |
| 294 | + path: .playwright/report/ |
| 295 | + retention-days: 30 |
| 296 | + - name: Failure |
| 297 | + if: ${{ steps.auto-commit.outputs.changes_detected == 'true' || steps.playwright-run.outcome == 'failure' }} |
| 298 | + run: exit 1 |
283 | 299 | selectors: |
284 | 300 | name: CSS coverage |
285 | | - runs-on: ubuntu-latest |
| 301 | + runs-on: |
| 302 | + labels: |
| 303 | + - runs-on |
| 304 | + - runner=16cpu-linux-x64 |
| 305 | + - run-id=${{ github.run_id }} |
286 | 306 | steps: |
287 | 307 | - name: Checkout |
288 | 308 | uses: actions/checkout@v4 |
|
0 commit comments