Skip to content

Commit 548d284

Browse files
Crash0v3rrid3claude
andcommitted
ci: add PR smoke-test workflow for the a11y-scan SPM plugin
Runs an end-to-end accessibility scan on every PR: builds the plugin and executes a real scan against the tests/spm harness (sample SwiftUI sources with intentional a11y issues), reusing the repo's own gated integration test (testA11yScanPluginRuns) so the invocation stays in one place. The scan downloads the BrowserStack CLI and makes authenticated calls, so it is gated to same-repo PRs (secrets are never exposed to fork PRs) and manual dispatch. Without the BROWSERSTACK_USERNAME / BROWSERSTACK_ACCESS_KEY secrets configured the e2e test XCTSkips and the job still passes. actions/checkout pinned by SHA to match existing workflows (DEVA11Y-476). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 9031d15 commit 548d284

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Smoke-tests the `a11y-scan` SwiftPM command plugin end-to-end on every PR:
2+
# builds the plugin and runs a real accessibility scan against the tests/spm
3+
# harness (sample SwiftUI sources with intentional a11y issues). It reuses the
4+
# repository's own gated integration test (testA11yScanPluginRuns) so the scan
5+
# invocation stays defined in exactly one place.
6+
#
7+
# The scan downloads the BrowserStack CLI and makes authenticated network calls,
8+
# so it needs BROWSERSTACK_USERNAME / BROWSERSTACK_ACCESS_KEY repo secrets. Those
9+
# secrets are never exposed to fork PRs, so this job is gated to same-repo PRs
10+
# (and manual dispatch); fork PRs skip it. If the secrets are not configured yet,
11+
# the end-to-end test XCTSkips and the job still passes (build + unit test only).
12+
name: SPM plugin smoke test
13+
14+
on:
15+
pull_request:
16+
branches: [main, master]
17+
workflow_dispatch:
18+
19+
permissions:
20+
contents: read
21+
22+
concurrency:
23+
group: spm-smoke-${{ github.ref }}
24+
cancel-in-progress: true
25+
26+
jobs:
27+
spm-smoke:
28+
name: a11y-scan end-to-end (SwiftPM)
29+
runs-on: macos-14
30+
timeout-minutes: 25
31+
# Secrets are unavailable to fork PRs, so the authenticated scan can only run
32+
# on same-repo PRs or a manual dispatch. Fork PRs skip this job.
33+
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.fork == false
34+
env:
35+
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
36+
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
37+
# Un-gates tests/spm/Tests/A11yDemoLibTests/testA11yScanPluginRuns, which is
38+
# skipped unless RUN_A11Y_SCAN=1 and BrowserStack credentials are present.
39+
RUN_A11Y_SCAN: "1"
40+
steps:
41+
- name: Checkout
42+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
43+
44+
- name: Swift toolchain
45+
run: swift --version
46+
47+
- name: Build plugin package
48+
run: swift build
49+
50+
- name: End-to-end scan smoke (tests/spm)
51+
working-directory: tests/spm
52+
run: swift test

0 commit comments

Comments
 (0)