Skip to content

Commit b2ad737

Browse files
authored
Initial commit
0 parents  commit b2ad737

22 files changed

Lines changed: 1792 additions & 0 deletions

.github/CODEOWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Uncomment the appropriate line
2+
3+
# @ONSdigital/keh-dev
4+
@ONS-Innovation/keh-dev

.github/pull_request_template.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<!-- markdownlint-disable MD041 -->
2+
## Overview
3+
4+
<!-- Provide an overview of the changes in this pull request -->
5+
6+
## Related Issues
7+
8+
<!-- List any related issues or pull requests here -->
9+
<!-- This can include issues from Jira but make sure *not* to link them -->
10+
11+
## Testing
12+
13+
<!-- Describe how to test the changes in this pull request -->
14+
15+
## Checklist
16+
17+
<!-- Please check off the following items before submitting this pull request -->
18+
<!-- If anything is not applicable, please explain why in the exemptions section -->
19+
20+
- [ ] I have reviewed the changes in this pull request
21+
- [ ] I have tested the changes locally
22+
- [ ] I have updated/created any relevant documentation
23+
- [ ] I have updated/created any relevant tests
24+
- [ ] All CI checks have passed
25+
- [ ] I have used a development Concourse pipeline to test the changes within a development environment
26+
- [ ] I have added any necessary labels to this pull request
27+
- [ ] I have assigned myself to this pull request
28+
- [ ] I have assigned the appropriate reviewers to this pull request
29+
30+
### Exemptions
31+
32+
<!-- If any of the above checklist items are not applicable, please explain why here -->
33+
34+
## Additional Notes
35+
36+
<!-- Add any additional notes or comments here -->

.github/workflows/ci-docs.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
name: Documentation CI
3+
on:
4+
push:
5+
branches: [main]
6+
paths: [docs/**]
7+
pull_request:
8+
branches: [main]
9+
paths: [docs/**]
10+
permissions:
11+
contents: read
12+
jobs:
13+
lint-docs:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # V4.3.1
18+
with:
19+
persist-credentials: false
20+
- name: Set up Node.js
21+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # V5
22+
with:
23+
node-version: "20"
24+
- name: Install markdownlint
25+
run: |
26+
npm install -g markdownlint-cli
27+
- name: Run markdownlint
28+
run: |
29+
markdownlint ./docs/**/*.md
30+
verify-build:
31+
runs-on: ubuntu-latest
32+
permissions:
33+
contents: read
34+
steps:
35+
- name: Checkout code
36+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # V4.3.1
37+
with:
38+
persist-credentials: false
39+
- name: Set up Python
40+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # V5.6.0
41+
with:
42+
python-version: 3.x
43+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
44+
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # V4.3.0
45+
with:
46+
key: mkdocs-material-${{ env.cache_id }}
47+
path: .cache
48+
restore-keys: |
49+
mkdocs-material-
50+
- run: pip install poetry
51+
- run: poetry config virtualenvs.create false
52+
- run: poetry install --only docs
53+
- run: mkdocs build

.github/workflows/ci-fmt.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Linting and Formatting
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- src/**
8+
- tests/**
9+
pull_request:
10+
branches: [main]
11+
paths:
12+
- src/**
13+
- tests/**
14+
permissions:
15+
contents: read
16+
jobs:
17+
lint:
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
steps:
22+
- name: Implement linting and formatting checks (TODO)
23+
run: |-
24+
echo "TODO: Implement linting and formatting checks"

.github/workflows/ci-test.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: Testing
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- src/**
8+
- tests/**
9+
pull_request:
10+
branches: [main]
11+
paths:
12+
- src/**
13+
- tests/**
14+
permissions:
15+
contents: read
16+
jobs:
17+
unit-tests:
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
steps:
22+
- name: Implement unit tests (TODO)
23+
run: |
24+
echo "TODO: Implement unit tests"
25+
ui-tests:
26+
runs-on: ubuntu-latest
27+
permissions:
28+
contents: read
29+
steps:
30+
- name: Implement UI tests (TODO)
31+
run: |
32+
echo "TODO: Implement UI tests"
33+
34+
# Add more test jobs as needed, such as integration tests, end-to-end tests, etc.

.github/workflows/deploy-docs.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: Deploy Documentation (MkDocs)
3+
on:
4+
push:
5+
branches: [main]
6+
paths: [docs/**]
7+
workflow_dispatch:
8+
permissions:
9+
contents: write
10+
jobs:
11+
deploy:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # V4.3.1
16+
with:
17+
persist-credentials: true # Persist credentials since git operations are used.
18+
- name: Configure Git Credentials
19+
run: |
20+
git config user.name github-actions[bot]
21+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
22+
- name: Set up Python
23+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # V5.6.0
24+
with:
25+
python-version: 3.x
26+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
27+
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # V4.3.0
28+
with:
29+
key: mkdocs-material-${{ env.cache_id }}
30+
path: .cache
31+
restore-keys: |
32+
mkdocs-material-
33+
- run: pip install poetry
34+
- run: poetry config virtualenvs.create false
35+
- run: poetry install --only docs
36+
- run: mkdocs gh-deploy --force

.github/workflows/mega-linter.yml

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
---
2+
name: MegaLinter
3+
4+
# Trigger mega-linter at every push. Action will also be visible from
5+
# Pull Requests to main
6+
on: # yamllint disable-line rule:truthy
7+
push:
8+
branches: [main]
9+
pull_request:
10+
branches: [main]
11+
permissions:
12+
contents: read
13+
# Comment env block if you do not want to apply fixes
14+
env:
15+
# Apply linter fixes configuration
16+
#
17+
# When active, APPLY_FIXES must also be defined as environment variable
18+
# (in github/workflows/mega-linter.yml or other CI tool)
19+
# This is dynamically set based on the presence of the PAT secret.
20+
# If the PAT secret is not present, the APPLY_FIXES environment variable is set to none.
21+
# Without a PAT token, commits/PRs will not trigger workflow runs.
22+
# This is a GitHub Actions limitation to prevent infinite loops.
23+
APPLY_FIXES: none
24+
25+
# Decide which event triggers application of fixes in a commit or a PR
26+
# (pull_request, push, all)
27+
# APPLY_FIXES_EVENT: pull_request
28+
29+
# If APPLY_FIXES is used, defines if the fixes are directly committed (commit)
30+
# or posted in a PR (pull_request)
31+
# APPLY_FIXES_MODE: commit
32+
33+
# Show individual linter status in GitHub Actions status summary
34+
GITHUB_STATUS_REPORTER: false
35+
36+
# Enable to show lint results in GitHub PR comments.
37+
GITHUB_COMMENT_REPORTER: true
38+
39+
# Set to simple to avoid external images in generated markdown
40+
REPORTERS_MARKDOWN_TYPE: simple
41+
concurrency:
42+
group: ${{ github.head_ref || github.ref }}-${{ github.workflow }}
43+
cancel-in-progress: true
44+
jobs:
45+
lint:
46+
name: MegaLinter
47+
runs-on: ubuntu-latest
48+
49+
# Give the default GITHUB_TOKEN write permission to commit and push, comment
50+
# issues, and post new Pull Requests; remove the ones you do not need
51+
permissions:
52+
contents: read
53+
issues: read
54+
pull-requests: read
55+
statuses: read
56+
steps:
57+
# Git Checkout
58+
- name: Checkout code
59+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # V4.3.1
60+
with:
61+
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
62+
persist-credentials: false
63+
64+
# If you use VALIDATE_ALL_CODEBASE = true, you can remove this line to
65+
# improve performance
66+
fetch-depth: 0
67+
68+
# - name: Check PAT and Set APPLY_FIXES
69+
# run: |
70+
# if [ -z "${{ secrets.PAT }}" ]; then
71+
# echo "APPLY_FIXES=none" >> "$GITHUB_ENV"
72+
# fi
73+
74+
# MegaLinter
75+
- name: MegaLinter
76+
77+
# You can override MegaLinter flavor used to have faster performances
78+
# More info at https://megalinter.io/latest/flavors/
79+
uses: oxsecurity/megalinter@0e3ce9b9c8c10effb9b269509cc47ca17cae31c7 # V9.5.0
80+
id: ml
81+
82+
# All available variables are described in documentation
83+
# https://megalinter.io/latest/config-file/
84+
env:
85+
# Validates all source when push on main, else just the git diff with
86+
# main. Override with true if you always want to lint all sources
87+
#
88+
# To validate the entire codebase, set to:
89+
# VALIDATE_ALL_CODEBASE: true
90+
#
91+
# To validate only diff with main, set to:
92+
# VALIDATE_ALL_CODEBASE: >-
93+
# ${{
94+
# github.event_name == 'push' &&
95+
# github.ref == 'refs/heads/main'
96+
# }}
97+
VALIDATE_ALL_CODEBASE: true
98+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
99+
100+
# ADD YOUR CUSTOM ENV VARIABLES HERE TO OVERRIDE VALUES OF
101+
# .mega-linter.yml AT THE ROOT OF YOUR REPOSITORY
102+
103+
# Upload MegaLinter artifacts
104+
- name: Archive production artifacts
105+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # V4.6.2
106+
if: success() || failure()
107+
with:
108+
name: MegaLinter reports
109+
path: |
110+
megalinter-reports
111+
mega-linter.log
112+
113+
# Create pull request if applicable
114+
# (for now works only on PR from same repository, not from forks)
115+
# - name: Create Pull Request with applied fixes
116+
# uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f
117+
# id: cpr
118+
# if: >-
119+
# steps.ml.outputs.has_updated_sources == 1 &&
120+
# (
121+
# env.APPLY_FIXES_EVENT == 'all' ||
122+
# env.APPLY_FIXES_EVENT == github.event_name
123+
# ) &&
124+
# env.APPLY_FIXES_MODE == 'pull_request' &&
125+
# (
126+
# github.event_name == 'push' ||
127+
# github.event.pull_request.head.repo.full_name == github.repository
128+
# ) &&
129+
# !contains(github.event.head_commit.message, 'skip fix')
130+
# with:
131+
# token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
132+
# commit-message: '[MegaLinter] Apply linters automatic fixes'
133+
# title: '[MegaLinter] Apply linters automatic fixes'
134+
# labels: bot
135+
136+
# - name: Create PR output
137+
# if: >-
138+
# steps.ml.outputs.has_updated_sources == 1 &&
139+
# (
140+
# env.APPLY_FIXES_EVENT == 'all' ||
141+
# env.APPLY_FIXES_EVENT == github.event_name
142+
# ) &&
143+
# env.APPLY_FIXES_MODE == 'pull_request' &&
144+
# (
145+
# github.event_name == 'push' ||
146+
# github.event.pull_request.head.repo.full_name == github.repository
147+
# ) &&
148+
# !contains(github.event.head_commit.message, 'skip fix')
149+
# run: |
150+
# echo "PR Number - ${{ steps.cpr.outputs.pull-request-number }}"
151+
# echo "PR URL - ${{ steps.cpr.outputs.pull-request-url }}"
152+
153+
# # Push new commit if applicable
154+
# # (for now works only on PR from same repository, not from forks)
155+
# - name: Prepare commit
156+
# if: >-
157+
# steps.ml.outputs.has_updated_sources == 1 &&
158+
# (
159+
# env.APPLY_FIXES_EVENT == 'all' ||
160+
# env.APPLY_FIXES_EVENT == github.event_name
161+
# ) &&
162+
# env.APPLY_FIXES_MODE == 'commit' &&
163+
# github.ref != 'refs/heads/main' &&
164+
# (
165+
# github.event_name == 'push' ||
166+
# github.event.pull_request.head.repo.full_name == github.repository
167+
# ) &&
168+
# !contains(github.event.head_commit.message, 'skip fix')
169+
# run: sudo chown -Rc $UID .git/
170+
171+
# - name: Commit and push applied linter fixes
172+
# uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842
173+
# if: >-
174+
# steps.ml.outputs.has_updated_sources == 1 &&
175+
# (
176+
# env.APPLY_FIXES_EVENT == 'all' ||
177+
# env.APPLY_FIXES_EVENT == github.event_name
178+
# ) &&
179+
# env.APPLY_FIXES_MODE == 'commit' &&
180+
# github.ref != 'refs/heads/main' &&
181+
# (
182+
# github.event_name == 'push' ||
183+
# github.event.pull_request.head.repo.full_name == github.repository
184+
# ) &&
185+
# !contains(github.event.head_commit.message, 'skip fix')
186+
# with:
187+
# branch: >-
188+
# ${{
189+
# github.event.pull_request.head.ref ||
190+
# github.head_ref ||
191+
# github.ref
192+
# }}
193+
# commit_message: '[MegaLinter] Apply linters fixes'

0 commit comments

Comments
 (0)