Skip to content

Commit 70badbe

Browse files
Merge pull request #55 from devopsabcs-engineering/feature/sync-with-ado
chore: sync with ADO pipelines and Power BI report
2 parents c1fd4b2 + 9a88275 commit 70badbe

70 files changed

Lines changed: 5994 additions & 331 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.azuredevops/pipelines/a11y-scan-advancedsecurity.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pool:
1212
vmImage: 'ubuntu-latest'
1313

1414
variables:
15-
SCANNER_BASE_URL: 'https://a11y-scan-demo-app.azurewebsites.net'
15+
- group: a11y-scan-config
1616

1717
strategy:
1818
matrix:
@@ -21,7 +21,7 @@ strategy:
2121
siteUrl: 'https://codepen.io/leezee/pen/eYbXzpJ'
2222
a11y-scan-demo-app:
2323
siteName: 'a11y-scan-demo-app'
24-
siteUrl: 'https://a11y-scan-demo-app.azurewebsites.net/'
24+
siteUrl: '$(SCANNER_URL)'
2525
ontario-gov:
2626
siteName: 'ontario-gov'
2727
siteUrl: 'https://www.ontario.ca/page/government-ontario'
@@ -34,7 +34,7 @@ steps:
3434
- script: |
3535
mkdir -p results
3636
HTTP_STATUS=$(curl -s -o results/$(siteName).sarif -w "%{http_code}" \
37-
-X POST "$(SCANNER_BASE_URL)/api/ci/scan" \
37+
-X POST "$(SCANNER_URL)/api/ci/scan" \
3838
-H "Content-Type: application/json" \
3939
-d '{"url": "$(siteUrl)", "format": "sarif"}' \
4040
--max-time 120)
Lines changed: 35 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,64 @@
11
trigger: none
2+
pr: none
23

34
schedules:
4-
- cron: '0 6 * * 1' # Every Monday at 06:00 UTC
5-
displayName: 'Weekly accessibility scan'
5+
- cron: '0 6 * * 1'
6+
displayName: 'Weekly Monday 06:00 UTC scan'
67
branches:
7-
include:
8-
- main
8+
include: [main]
99
always: true
1010

11+
parameters:
12+
- name: scanTargets
13+
displayName: 'Override scan targets (leave empty for defaults)'
14+
type: string
15+
default: ''
16+
1117
pool:
1218
vmImage: 'ubuntu-latest'
1319

1420
variables:
15-
SCANNER_BASE_URL: 'https://a11y-scan-demo-app.azurewebsites.net'
21+
- group: a11y-scan-config
1622

1723
strategy:
1824
matrix:
19-
codepen-sample:
20-
siteName: 'codepen-sample'
21-
siteUrl: 'https://codepen.io/leezee/pen/eYbXzpJ'
22-
a11y-scan-demo-app:
23-
siteName: 'a11y-scan-demo-app'
24-
siteUrl: 'https://a11y-scan-demo-app.azurewebsites.net/'
25-
ontario-gov:
26-
siteName: 'ontario-gov'
27-
siteUrl: 'https://www.ontario.ca/page/government-ontario'
28-
maxParallel: 3
25+
codepen_sample:
26+
scanName: 'codepen-sample'
27+
scanUrl: 'https://codepen.io/leezee/pen/eYbXzpJ'
28+
a11y_scan_demo_app:
29+
scanName: 'a11y-scan-demo-app'
30+
scanUrl: '$(SCANNER_URL)'
31+
ontario_gov:
32+
scanName: 'ontario-gov'
33+
scanUrl: 'https://www.ontario.ca/page/government-ontario'
2934

3035
steps:
3136
- checkout: self
32-
displayName: 'Checkout repository'
3337

3438
- script: |
3539
mkdir -p results
36-
HTTP_STATUS=$(curl -s -o results/$(siteName).sarif -w "%{http_code}" \
37-
-X POST "$(SCANNER_BASE_URL)/api/ci/scan" \
40+
HTTP_STATUS=$(curl -s -o results/$(scanName).sarif -w "%{http_code}" \
41+
-X POST "$(SCANNER_URL)/api/ci/scan" \
3842
-H "Content-Type: application/json" \
39-
-d '{"url": "$(siteUrl)", "format": "sarif"}' \
43+
-d '{"url": "$(scanUrl)", "format": "sarif"}' \
4044
--max-time 120)
41-
4245
echo "HTTP status: $HTTP_STATUS"
43-
4446
if [ "$HTTP_STATUS" -ne 200 ]; then
45-
echo "##vso[task.logissue type=error]Scan failed for $(siteUrl) (HTTP $HTTP_STATUS)"
46-
cat results/$(siteName).sarif
47+
echo "##vso[task.logissue type=error]Scan failed for $(scanUrl) (HTTP $HTTP_STATUS)"
48+
cat results/$(scanName).sarif
4749
exit 1
4850
fi
51+
displayName: 'Run accessibility scan for $(scanName)'
4952
50-
echo "SARIF file written: results/$(siteName).sarif"
51-
echo "File size: $(wc -c < results/$(siteName).sarif) bytes"
52-
displayName: 'Run accessibility scan - $(siteName)'
53-
timeoutInMinutes: 5
54-
55-
- task: PublishBuildArtifacts@1
56-
condition: always()
53+
- task: PublishPipelineArtifact@1
5754
inputs:
58-
pathToPublish: 'results'
59-
artifactName: 'a11y-sarif-$(siteName)'
60-
displayName: 'Publish SARIF artifact - $(siteName)'
61-
62-
- task: PublishBuildArtifacts@1
55+
targetPath: 'results/$(scanName).sarif'
56+
artifactName: 'sarif-$(scanName)'
6357
condition: always()
64-
inputs:
65-
pathToPublish: 'results'
66-
artifactName: 'CodeAnalysisLogs'
67-
displayName: 'Publish to Scans tab - $(siteName)'
58+
displayName: 'Publish SARIF artifact'
6859

69-
- task: AdvancedSecurity-Publish@1
70-
condition: always()
71-
inputs:
72-
SarifsInputDirectory: '$(Build.SourcesDirectory)/results'
73-
displayName: 'Publish SARIF to Advanced Security - $(siteName)'
60+
# Optional: Upload to ADO Advanced Security (requires GHAzDO license)
61+
# - task: AdvancedSecurity-Publish@1
62+
# inputs:
63+
# SarifFile: 'results/$(scanName).sarif'
64+
# condition: always()

.azuredevops/pipelines/adv-sec-scan.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pool:
55
vmImage: ubuntu-latest
66

77
variables:
8-
SCANNER_BASE_URL: 'https://a11y-scan-demo-app.azurewebsites.net'
8+
- group: a11y-scan-config
99

1010
steps:
1111
- task: AdvancedSecurity-Codeql-Init@1
@@ -22,9 +22,9 @@ steps:
2222
- script: |
2323
mkdir -p results
2424
HTTP_STATUS=$(curl -s -o results/a11y-scan.sarif -w "%{http_code}" \
25-
-X POST "$(SCANNER_BASE_URL)/api/ci/scan" \
25+
-X POST "$(SCANNER_URL)/api/ci/scan" \
2626
-H "Content-Type: application/json" \
27-
-d '{"url": "$(SCANNER_BASE_URL)", "format": "sarif"}' \
27+
-d '{"url": "$(SCANNER_URL)", "format": "sarif"}' \
2828
--max-time 120)
2929
3030
echo "HTTP status: $HTTP_STATUS"

.azuredevops/pipelines/ci.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
trigger:
2+
batch: true
3+
branches:
4+
include: [main]
5+
6+
pr:
7+
branches:
8+
include: [main]
9+
10+
pool:
11+
vmImage: 'ubuntu-latest'
12+
13+
variables:
14+
- group: a11y-scan-config
15+
16+
steps:
17+
- checkout: self
18+
19+
- task: UseNode@1
20+
inputs:
21+
version: '20.x'
22+
displayName: 'Use Node.js 20.x'
23+
24+
- script: npm ci
25+
displayName: 'Install dependencies'
26+
27+
- script: npm run lint
28+
displayName: 'Lint'
29+
30+
- script: npm run test:ci
31+
displayName: 'Test with coverage'
32+
33+
- task: PublishTestResults@2
34+
inputs:
35+
testResultsFormat: JUnit
36+
testResultsFiles: 'test-results/junit.xml'
37+
testRunTitle: 'Unit Tests'
38+
condition: always()
39+
displayName: 'Publish unit test results'
40+
41+
- task: PublishCodeCoverageResults@2
42+
inputs:
43+
summaryFileLocation: 'coverage/cobertura-coverage.xml'
44+
condition: always()
45+
displayName: 'Publish code coverage'
46+
47+
- task: Cache@2
48+
inputs:
49+
key: 'nextjs | "$(Agent.OS)" | package-lock.json | src/**'
50+
path: .next/cache
51+
displayName: 'Cache Next.js build'
52+
53+
- script: npm run build
54+
displayName: 'Build'
55+
56+
- script: npx playwright install --with-deps chromium
57+
displayName: 'Install Playwright'
58+
59+
- script: npm run test:a11y
60+
displayName: 'Accessibility tests'
61+
62+
- task: PublishTestResults@2
63+
inputs:
64+
testResultsFormat: JUnit
65+
testResultsFiles: 'test-results/a11y-junit.xml'
66+
testRunTitle: 'Accessibility Tests'
67+
condition: always()
68+
displayName: 'Publish accessibility test results'
69+
70+
- task: PublishPipelineArtifact@1
71+
inputs:
72+
targetPath: 'playwright-report/'
73+
artifactName: 'a11y-results'
74+
condition: always()
75+
displayName: 'Publish accessibility report'

0 commit comments

Comments
 (0)