Skip to content

Commit 2b735dc

Browse files
Merge branch 'main' into dependabot/docker/python-3.13-slim
2 parents 1b08bd8 + 01245c6 commit 2b735dc

Some content is hidden

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

48 files changed

+33354
-2363
lines changed

.editorconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,11 @@ indent_size = 4
1919

2020
[{Makefile,*.mk,go.mod,go.sum,*.go,.gitmodules}]
2121
indent_style = tab
22+
23+
[{axe.js,axe.min.js}]
24+
charset = unset
25+
end_of_line = unset
26+
insert_final_newline = unset
27+
trim_trailing_whitespace = unset
28+
indent_style = unset
29+
indent_size = unset
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: "Check axe-core version"
2+
description: "Checks if our copy of axe-core is up to date"
3+
4+
jobs:
5+
build:
6+
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v4
11+
- name: Create dependency update branch
12+
run: |
13+
git checkout -b axe-dependency-check
14+
git config --local user.email "action@github.com"
15+
git config --local user.name "GitHub Action"
16+
- name: Install Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 'latest'
20+
- name: Install axe-core in temp dir
21+
run: |
22+
cd utils/resouces
23+
mkdir temp
24+
cd temp
25+
npm install axe-core
26+
- name: Retrieve axe.js file
27+
run: |
28+
cd node_modules/axe-core
29+
mv axe.js ../../../
30+
- name: Remove temp directory
31+
run: |
32+
cd ../../../
33+
rm -rf temp
34+
- name: Stage & commit file
35+
run: |
36+
git stage axe.js
37+
git diff-index --quiet HEAD || (git commit -a -m "axe.js scheduled update" --allow-empty)
38+
- name: Push changes to branch
39+
uses: ad-m/github-push-action@v0.6.0
40+
with:
41+
github_token: ${{ secrets.PUSH_TOKEN }}
42+
branch: axe-dependency-check
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Run Axe Dependency Check
2+
3+
on: [workflow_dispatch]
4+
5+
jobs:
6+
axe-dependency-check:
7+
name: "Axe Version Check"
8+
runs-on: ubuntu-latest
9+
timeout-minutes: 10
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
- run: |
15+
git checkout ${{ github.head_ref || github.ref_name }}
16+
- name: Install Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 'latest'
20+
- name: Install axe-core in temp dir
21+
run: |
22+
cd utils/resources
23+
mkdir temp
24+
cd temp
25+
npm install axe-core
26+
- name: Retrieve axe.js file
27+
run: |
28+
cd utils/resources/temp/node_modules/axe-core
29+
mv axe.js ../../../
30+
- name: Remove temp directory
31+
run: |
32+
cd utils/resources
33+
rm -rf temp
34+
- name: Commit to axe-dependency-check branch
35+
run: |
36+
git config user.name "github-actions[bot]"
37+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
38+
git add utils/resources/axe.js
39+
git commit -m "axe-core automated update"
40+
git push

.github/workflows/stage-3-build.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ on:
3030

3131
jobs:
3232
run-tests:
33-
name: "Run Example Tests"
33+
name: "Run Util & Example Tests"
3434
runs-on: ubuntu-latest
3535
timeout-minutes: 3
3636
steps:
3737
- uses: actions/checkout@v4
3838
- name: Set up Python
39-
uses: actions/setup-python@v4
39+
uses: actions/setup-python@v5
4040
with:
4141
python-version: '3.12'
4242
- name: Install dependencies
@@ -45,6 +45,8 @@ jobs:
4545
pip install -r requirements.txt
4646
- name: Ensure browsers are installed
4747
run: python -m playwright install --with-deps
48+
- name: Run util tests
49+
run: pytest -m "utils" --ignore=tests/
4850
- name: Run example tests
4951
run: pytest
5052
- uses: actions/upload-artifact@v4

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515
__pycache__/
1616
.pytest_cache/
1717
test-results/
18+
axe-reports/

.gitleaks.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This allows for the ignoring of secret scanning against axe-core, as whilst it is in our code base we don't control it
2+
3+
[allowlist]
4+
description = "global allow list"
5+
paths = [
6+
'''(.*?)(axe.js|axe.min.js)'''
7+
]

.gitleaksignore

Lines changed: 220 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ NOTE: This project is currently under initial development so isn't finalised, bu
1616
- [Prerequisites](#prerequisites)
1717
- [Configuration](#configuration)
1818
- [Getting Started](#getting-started)
19+
- [Utilities](#utilities)
1920
- [Contacts](#contacts)
2021
- [Licence](#licence)
2122

@@ -66,6 +67,15 @@ We've also created a [Quick Reference Guide](./docs/getting-started/Quick_Refere
6667

6768
For additional reading and guidance on writing tests, we also recommend reviewing the [Playwright Python documentation](https://playwright.dev/python/docs/writing-tests).
6869

70+
## Utilities
71+
72+
This blueprint also provides the following utility classes, that can be used to aid in testing:
73+
74+
|Utility|Description|
75+
|-------|-----------|
76+
|[Axe](./docs/utility-guides/Axe.md)|Accessibility scanning using axe-core.|
77+
|NHSNumberTools|Basic tools for working with NHS numbers.|
78+
6979
## Contacts
7080

7181
If you have any queries regarding this blueprint, please contact [dave.harding1@nhs.net](mailto:dave.harding1@nhs.net).

docs/adr/ADR-001_Use_git_hook_and_GitHub_action_to_check_the_editorconfig_compliance.md

Lines changed: 0 additions & 148 deletions
This file was deleted.

0 commit comments

Comments
 (0)