Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/gh-pages' into gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
dsmithsl committed Jan 8, 2024
2 parents 14517ac + 51d6726 commit 684b386
Show file tree
Hide file tree
Showing 138 changed files with 4,988 additions and 8,050 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/check-a11y-of-changed-content.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Check accessibility of changed content

on:
workflow_dispatch:
pull_request:

permissions:
contents: read
pull-requests: read

concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
check-a11y-of-changed-content:
name: Check accessibility of changed content
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Fetch gh-pages branch
run: >-
git fetch origin gh-pages
&& git branch gh-pages origin/gh-pages;
- name: Calculate URLs and output to JavaScript module
run: >-
chmod +x ./generate_pa11y_ci_urls_from_git_diff.sh
&& ./generate_pa11y_ci_urls_from_git_diff.sh gh-pages
>> ./pa11y-ci-urls.js;
- name: Log contents of resulting JavaScript module
run: cat ./pa11y-ci-urls.js;

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.3

- name: Install gems
run: bundle config path vendor/bundle && bundle install

- name: Run the blog
run: bundle exec jekyll serve &

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.10.x
cache: npm

- name: Install NPM dependencies
run: npm ci

- name: Setup Chrome
uses: browser-actions/setup-chrome@v1
id: setup-chrome

- name: Wait for blog to be running
run: npx wait-on http://localhost:4000 --timeout 60000

- name: Run pa11y-ci
run: CHROMIUM_BIN=$(which chrome) npx pa11y-ci
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ Gemfile.lock

/container_gem_cache/
/dist/
/scripts/generate-related/data/
/scripts/generate-related/data/

# Automatically generated by generate_pa11y_ci_urls_from_git_diff.sh
/pa11y-ci-urls.js
32 changes: 32 additions & 0 deletions .pa11yci.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/// This is a configuration file automatically picked up by pa11y-ci.

const relativeUrls = require('./pa11y-ci-urls');

const chromiumBin = process.env.CHROMIUM_BIN;
if (!chromiumBin) {
throw new Error('CHROMIUM_BIN environment variable is not set');
}

const baseUrl = 'http://localhost:4000';

// Colour contrast is a known issue. If we ever fix the brand colours, this should be removed.
const colourContrastRuleIds = [
// HTML CodeSniffer rule IDs come from section 1.4.3 of:
// https://squizlabs.github.io/HTML_CodeSniffer/Standards/WCAG2/
'WCAG2AA.Principle1.Guideline1_4.1_4_3.G18.Fail', // normal text
'WCAG2AA.Principle1.Guideline1_4.1_4_3.G145.Fail', // large text
];

module.exports = {
defaults: {
chromeLaunchConfig: {
executablePath: chromiumBin,
},
ignore: [
...colourContrastRuleIds,
],
reporter: 'cli',
runners: ['htmlcs'],
},
urls: relativeUrls.map((url) => `${baseUrl}${url}`),
};
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,42 @@ BLOG_USERNAME=abirch ./shell/docker-dev-watch.sh

Visit the blog on [localhost][localhost].

## CI/CD

We use GitHub Actions for CI/CD. The workflow definitions are in YAML files
in `.github/workflows`.

### Compress Images Once a Month

Uses the [calibreapp/image-actions][calibreapp-image-actions] Action to
automatically compress images. The compression algorithm is near-lossless. It
compresses all images in the repo once per month, and creates a Pull Request to
merge in the resulting changes.

### Check accessibility of changed content

Runs [pa11y-ci][pa11y-ci] with the aXe test runner to detect some common
accessibility problems. It serves the blog locally and runs the tests on the
rendered webpages. It only checks pages and blog posts which have changed, but
doesn’t take any interest in changes to layouts or includes, so changes to
those should be tested across the whole site separately. This workflow runs on
Pull Requests, pushes to `gh-pages` and on manual dispatches.

### Generate Read More related

Generates Read More links on blog pages across the blog, using the OpenAI API
to determine which blog posts are on similar themes. This workflow runs only on
manual dispatches on the `gh-pages` branch and creates a Pull Request to merge
in the resulting changes.

### Remove Unused Images

For each image in the repo, searches all the blog posts, pages, YAML data files
and JavaScript scripts for any occurrences of its filename. If the filename
occurs nowhere, deletes the image. Then makes a Pull Request to merge in its
changes. This workflow runs only on a manual dispatch on the `gh-pages` branch.

[calibreapp-image-actions]: https://github.com/calibreapp/image-actions
[confluence-getting-started]: https://scottlogic.atlassian.net/wiki/spaces/INT/pages/3577479175/Getting+started+with+the+Scott+Logic+blog
[sparse-checkout-guide]: https://github.blog/2020-01-17-bring-your-monorepo-down-to-size-with-sparse-checkout/#sparse-checkout-and-partial-clones
[github-ssh]: https://docs.github.com/en/authentication/connecting-to-github-with-ssh
Expand All @@ -165,6 +201,7 @@ Visit the blog on [localhost][localhost].
[ruby-nokogiri]: https://nokogiri.org/
[ruby-liquid]: https://shopify.github.io/liquid/
[ruby-downloads]: https://www.ruby-lang.org/en/downloads/
[pa11y-ci]: https://github.com/pa11y/pa11y-ci
[project-gemfile]: Gemfile
[install-docker]: #docker

70 changes: 54 additions & 16 deletions _data/authors.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,50 @@
active-authors:
- amcgill
- aaiken
- abagdonaite
- abarron
- abirch
- aberrill
- abirch
- acarr
- acaulfield
- ahickman
- alee
- amcgill
- amjones
- asegrove
- ashing
- awhitmell
- bpritchard
- bwallis
- colive
- ccocks
- ceberhardt
- cferguson
- cfisher
- chayes
- ckoris
- mhowie
- colive
- cprice
- csalt
- cstephen
- dgrew
- dhinrichs
- dhope
- dhunter
- dkerr
- dmcnamee
- dnicholas
- dscarborough
- dogle
- drees
- dscarborough
- dsmith
- ebrown
- emason
- fhubin
- gsmith
- fvlachos
- garora
- gkendall
- godds
- gsingh
- gsmith
- gsproston
- hashbyha
- hbedford
- hbellamy
Expand All @@ -55,7 +58,6 @@ active-authors:
- jharris
- jhenderson
- jheward
- jhowlett
- jleftley
- jmcevoy
- jporter
Expand All @@ -66,22 +68,24 @@ active-authors:
- jwhite
- jwren
- kangel
- kcoombes
- kclark
- kjones
- dhunter
- kcoombes
- kday
- kjones
- klau
- lcollingwood
- lpisani
- lperrett
- lvincent
- lwilson
- magnussmith
- masmith
- mbuhagiar
- mcooke
- mdunsdon
- mholland
- mgrabara
- mgriffin
- mhowie
- mking
- mmcalroy
- mmoxon
Expand All @@ -95,7 +99,6 @@ active-authors:
- osouthwell
- pdykes
- pgraham
- pholman
- rbeckett
- rgarside
- rgraham
Expand All @@ -120,11 +123,12 @@ active-authors:
- tclarke-scottlogic
- tgilbert
- thands
- wreilly
- wtrimble
- wboothclibborn
- wduncan
- wreilly
- wtrimble
- xchen
- yblowers
- zrubin
- zwali
authors:
Expand Down Expand Up @@ -253,6 +257,10 @@ authors:
cgrant:
name: "Chris Grant"
picture: picture.jpg
chayes:
name: "Charlotte Hayes"
author-summary: "I'm Charlotte, a Senior Test Engineer based in Edinburgh. I am passionate about exploring the latest test automation technologies as well as examining the intersection between continuous improvement methodologies and QA. I have a keen interest in exploring the role that we, as technologists, can play in developing more sustainable technology."
picture: picture.jpg
ckurzeja:
name: "Chris Kurzeja"
picture: image.jpg
Expand Down Expand Up @@ -1177,7 +1185,7 @@ authors:
picture: rgrey-profile-pic-small-2019.png
jspruce:
name: "Jonny Spruce"
author-summary: "I'm a Graduate Developer at Scott Logic's Newcastle Office. I'm most familiar with both Node and Python development but am always keen to learn more. Outside of work I enjoy singing/playing guitar and playing football."
author-summary: "I'm a Senior Developer at Scott Logic's Newcastle Office. I'm experienced in both Java and Python development and have a keen interest in code quality. Outside of work I enjoy singing/playing guitar and playing football."
twitter-handle: "http://www.twitter.com/jonnyspruce"
picture: jspruce.png
ckoris:
Expand Down Expand Up @@ -1244,6 +1252,10 @@ authors:
author-summary: "Initially from a Marine Engineering background, I am a Senior Test Engineer with Scott Logic, based in Newcastle with twenty plus years software testing experience. Away from the keyboard, if I'm not concocting home brew, I'm either at the allotment or out on the kayak."
twitter-handle: null
picture: picture.jpg
gsproston:
name: "George Sproston"
author-summary: "Hi I'm George, a senior dev living in Glasgow. In the summer I roller skate and in the winter I hibernate"
picture: picture.jpg
mjrichards:
name: "Mark Richards"
author-summary: "I am a Senior Developer at Scott Logic."
Expand Down Expand Up @@ -1364,3 +1376,29 @@ authors:
email: [email protected]
author-summary: "I'm a developer based out of our Bristol office. I'm a bit of a generalist; I like to get stuck into a range of problems from the business side to anywhere across the tech stack."
picture: Image.png
fvlachos:
name: "Fanis Vlachos"
email: [email protected]
author-summary: "I am a Senior Developer at Scott Logic, based in Edinburgh. I love solving problems using software and I am passionate about learning new technologies."
picture: picture.jpg
mgriffin:
name: "Matt Griffin"
email: [email protected]
author-summary: "Developer based in the Newcastle office. Ex-Games programmer and worked with plenty of things involving C++ and 3D graphics."
picture: picture.jpg
yblowers:
name: "Yotaka Blowers"
author-summary: "I'm a Senior Developer, based in our Newcastle office"
picture: yblowers.jpeg
lperrett:
name: "Lisa Perrett"
author-summary: "I'm a Senior Test Engineer, based in our Newcastle office"
picture: lisa-profile.png
lvincent:
name: "Luke Vincent"
author-summary: "I'm a Senior Developer, based in our Bristol Office"
picture: lv_profile.jpg
cferguson:
name: "Chris Ferguson"
author-summary: "Joining Scott Logic in October 2021, Chris leads the growth and development of the professional services business. He was one of the original team that built the UK’s Government Digital Service from 2011 onwards. As Director from 2015, he formed and led the GDS Digital Group: GOV.UK; GOV.UK Verify; the Government-as-a-Platform Programme; and the Service Design Team. In their free time, Chris and his wife enjoy walking their golden retriever Lockie on the hills and coastline of Lothian and Fife, where they live."
picture: profile.jpg
Loading

0 comments on commit 684b386

Please sign in to comment.