Skip to content

Commit db718d1

Browse files
committed
Merge branch 'main' into feature/andys_bcss_test_branch
2 parents 42c51ac + 6c7ae0d commit db718d1

Some content is hidden

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

55 files changed

+33701
-2425
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/cicd-1-pull-request.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
version: "${{ needs.metadata.outputs.version }}"
8989
secrets: inherit
9090
build-stage: # Recommended maximum execution time is 3 minutes
91-
name: "Build stage"
91+
name: "Build & Assurance stage"
9292
needs: [metadata, test-stage]
9393
uses: ./.github/workflows/stage-3-build.yaml
9494
if: needs.metadata.outputs.does_pull_request_exist == 'true' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'reopened'))
@@ -100,16 +100,16 @@ jobs:
100100
python_version: "${{ needs.metadata.outputs.python_version }}"
101101
version: "${{ needs.metadata.outputs.version }}"
102102
secrets: inherit
103-
acceptance-stage: # Recommended maximum execution time is 10 minutes
104-
name: "Acceptance stage"
105-
needs: [metadata, build-stage]
106-
uses: ./.github/workflows/stage-4-acceptance.yaml
107-
if: needs.metadata.outputs.does_pull_request_exist == 'true' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'reopened'))
108-
with:
109-
build_datetime: "${{ needs.metadata.outputs.build_datetime }}"
110-
build_timestamp: "${{ needs.metadata.outputs.build_timestamp }}"
111-
build_epoch: "${{ needs.metadata.outputs.build_epoch }}"
112-
nodejs_version: "${{ needs.metadata.outputs.nodejs_version }}"
113-
python_version: "${{ needs.metadata.outputs.python_version }}"
114-
version: "${{ needs.metadata.outputs.version }}"
115-
secrets: inherit
103+
# acceptance-stage: # Recommended maximum execution time is 10 minutes
104+
# name: "Acceptance stage"
105+
# needs: [metadata, build-stage]
106+
# uses: ./.github/workflows/stage-4-acceptance.yaml
107+
# if: needs.metadata.outputs.does_pull_request_exist == 'true' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'reopened'))
108+
# with:
109+
# build_datetime: "${{ needs.metadata.outputs.build_datetime }}"
110+
# build_timestamp: "${{ needs.metadata.outputs.build_timestamp }}"
111+
# build_epoch: "${{ needs.metadata.outputs.build_epoch }}"
112+
# nodejs_version: "${{ needs.metadata.outputs.nodejs_version }}"
113+
# python_version: "${{ needs.metadata.outputs.python_version }}"
114+
# version: "${{ needs.metadata.outputs.version }}"
115+
# secrets: inherit

.github/workflows/cicd-2-publish.yaml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -76,20 +76,20 @@ jobs:
7676
# asset_path: ./*
7777
# asset_name: repository-template-${{ needs.metadata.outputs.version }}.tar.gz
7878
# asset_content_type: "application/gzip"
79-
success:
80-
name: "Success notification"
81-
runs-on: ubuntu-latest
82-
needs: [publish]
83-
steps:
84-
- name: "Check prerequisites for notification"
85-
id: check
86-
run: echo "secret_exist=${{ secrets.TEAMS_NOTIFICATION_WEBHOOK_URL != '' }}" >> $GITHUB_OUTPUT
87-
- name: "Notify on publishing packages"
88-
if: steps.check.outputs.secret_exist == 'true'
89-
uses: nhs-england-tools/notify-msteams-action@v1.0.0
90-
with:
91-
github-token: ${{ secrets.GITHUB_TOKEN }}
92-
teams-webhook-url: ${{ secrets.TEAMS_NOTIFICATION_WEBHOOK_URL }}
93-
message-title: "Notification title"
94-
message-text: "This is a notification body"
95-
link: ${{ github.event.pull_request.html_url }}
79+
# success:
80+
# name: "Success notification"
81+
# runs-on: ubuntu-latest
82+
# needs: [publish]
83+
# steps:
84+
# - name: "Check prerequisites for notification"
85+
# id: check
86+
# run: echo "secret_exist=${{ secrets.TEAMS_NOTIFICATION_WEBHOOK_URL != '' }}" >> $GITHUB_OUTPUT
87+
# - name: "Notify on publishing packages"
88+
# if: steps.check.outputs.secret_exist == 'true'
89+
# uses: nhs-england-tools/notify-msteams-action@v1.0.0
90+
# with:
91+
# github-token: ${{ secrets.GITHUB_TOKEN }}
92+
# teams-webhook-url: ${{ secrets.TEAMS_NOTIFICATION_WEBHOOK_URL }}
93+
# message-title: "Notification title"
94+
# message-text: "This is a notification body"
95+
# link: ${{ github.event.pull_request.html_url }}
Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Build stage"
1+
name: "Build & Assurance stage"
22

33
on:
44
workflow_call:
@@ -29,37 +29,29 @@ on:
2929
type: string
3030

3131
jobs:
32-
artefact-1:
33-
name: "Artefact 1"
32+
run-tests:
33+
name: "Run Util & Example Tests"
3434
runs-on: ubuntu-latest
3535
timeout-minutes: 3
3636
steps:
37-
- name: "Checkout code"
38-
uses: actions/checkout@v4
39-
- name: "Build artefact 1"
37+
- uses: actions/checkout@v4
38+
- name: Set up Python
39+
uses: actions/setup-python@v5
40+
with:
41+
python-version: '3.12'
42+
- name: Install dependencies
4043
run: |
41-
echo "Building artefact 1 ..."
42-
- name: "Check artefact 1"
43-
run: |
44-
echo "Checking artefact 1 ..."
45-
- name: "Upload artefact 1"
46-
run: |
47-
echo "Uploading artefact 1 ..."
48-
# TODO: Use either action/cache or action/upload-artifact
49-
artefact-2:
50-
name: "Artefact 2"
51-
runs-on: ubuntu-latest
52-
timeout-minutes: 3
53-
steps:
54-
- name: "Checkout code"
55-
uses: actions/checkout@v4
56-
- name: "Build artefact 2"
57-
run: |
58-
echo "Building artefact 2 ..."
59-
- name: "Check artefact 2"
60-
run: |
61-
echo "Checking artefact 2 ..."
62-
- name: "Upload artefact 2"
63-
run: |
64-
echo "Uploading artefact 2 ..."
65-
# TODO: Use either action/cache or action/upload-artifact
44+
python -m pip install --upgrade pip
45+
pip install -r requirements.txt
46+
- name: Ensure browsers are installed
47+
run: python -m playwright install --with-deps
48+
- name: Run util tests
49+
run: pytest -m "utils" --ignore=tests/
50+
- name: Run example tests
51+
run: pytest
52+
- uses: actions/upload-artifact@v4
53+
if: ${{ !cancelled() }}
54+
with:
55+
name: result-output
56+
path: test-results/
57+
retention-days: 5

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ __pycache__/
1717
test-results/
1818
/tests/examples/
1919
/.idea/
20+
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+
]

0 commit comments

Comments
 (0)