-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cache the docker images that GH Actions use.
- Loading branch information
Showing
3 changed files
with
144 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
name: Re-setting site, for CI Tests | ||
description: Setup Docker with caching and Buildx | ||
|
||
inputs: | ||
token: | ||
description: A GitHub token | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install go-task | ||
uses: arduino/setup-task@v2 | ||
with: | ||
repo-token: ${{ inputs.token }} | ||
|
||
- name: Cache Docker layers | ||
uses: actions/cache@v3 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Enable Docker BuildKit and Setup Buildx | ||
shell: bash | ||
run: | | ||
export DOCKER_BUILDKIT=1 | ||
docker buildx create --use | ||
- name: Build and cache Docker images | ||
shell: bash | ||
run: | | ||
export DOCKER_BUILDKIT=1 | ||
docker compose build \ | ||
--cache-from=type=local,src=/tmp/.buildx-cache \ | ||
--cache-to=type=local,dest=/tmp/.buildx-cache-new | ||
- name: Setup site | ||
shell: bash | ||
run: task ci:reset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
--- | ||
name: CI site tests | ||
on: pull_request | ||
|
||
jobs: | ||
LightHouse: | ||
name: Test site performance using Lighthouse | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Re-setting site | ||
uses: ./.github/actions/site-reset | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Run Lighthouse test | ||
run: task ci:lighthouse | ||
- name: Archive logs | ||
uses: actions/upload-artifact@v4 | ||
if: ${{ always() }} | ||
with: | ||
name: lighthouse-results | ||
path: .lighthouseci | ||
|
||
Pa11y: | ||
name: Test accessibility using Pa11y | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Re-setting site | ||
uses: ./.github/actions/site-reset | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Run Pa11y | ||
run: task ci:pa11y | ||
- name: Archive screenshots | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: pa11y-screenshots | ||
path: pa11y/screenshots | ||
|
||
Cypress: | ||
name: Run Cypress functional tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Re-setting site | ||
uses: ./.github/actions/site-reset | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Run Cypress | ||
run: task ci:cypress | ||
- name: Archive videoes | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: cypress-videos | ||
path: cypress/videos | ||
- name: Archive screenshots | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: cypress-screenshots | ||
path: cypress/screenshots | ||
|
||
CheckOpenApiSpec: | ||
name: Check OpenAPI specification | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Re-setting site | ||
uses: ./.github/actions/site-reset | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Validate specification | ||
run: task ci:openapi:validate | ||
- name: Download current specification | ||
run: task ci:openapi:download | ||
- name: Ensure specification has not drifted | ||
run: git diff --ignore-space-at-eol --exit-code openapi.json | ||
- name: Generate package for CMS API specification | ||
run: task dev:codegen:dpl-cms | ||
- name: Ensure CMS API package code has not drifted | ||
run: git diff --ignore-space-at-eol --exit-code packages/cms-api/* | ||
|
||
CheckDrupalConfig: | ||
name: Check Drupal Config | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Re-setting site | ||
uses: ./.github/actions/site-reset | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Export configuration | ||
run: task dev:cli -- drush config-export -y | ||
- name: Check for uncommited configuration after install | ||
run: git diff --ignore-space-at-eol --exit-code config/sync/*.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters