Skip to content

Commit

Permalink
Deploy 10-01-2024 dev to main (#374)
Browse files Browse the repository at this point in the history
* chore: Update all outdated drupal/* packages.

* CD-511 Samples module and PWA update (#344)

* feat: install Samples module, and update PWA due to bug while saving Samples permission

Refs: CD-511

* chore: enable Samples module

Refs: CD-511

* chore: set permissions for samples, pwa

Refs: CD-511

* Update local folder with most recent from unocha for consistency (#346)

* chore: uodate local folder with most recent from unocha for consistency

* chore: comment out contrib modules and themes from docker-compose as is standard

* CD-511 Follow up PWA module (#345)

* chore: enable pwa submodules and configure, add patch for missing labels

Refs: CD-511

* chore: remove leftover patch no longer referenced in patch file

Refs: CD-511

* chore: uodate local folder with most recent from unocha for consistency

* chore: more PWA config, disable one sub module as it is not needed

Refs: CD-511

* chore: comment out contrib modules and themes from docker-compose as is standard

* chore: add social_auth scope to config

Refs: CD-516

* chore: Update all outdated drupal/* packages.

* chore: update local stack for consistency

Refs: local-stack

* OPS-9885 Uninstall PWA (#355)

* chore: uninstall pwa

Refs: CD-511

* chore: remove pwa patch

Refs: OPS-9885

* chore: remove pwa from config

Refs: OPS-9885

* chore: update base theme to v9.2.2 (#356)

Refs: OPS-9885

* Automatic Composer Update (#354)

* chore: Update all outdated drupal/* packages.

* chore: update theme and bump versions of other modules

Refs: updates

---------

Co-authored-by: Andy Footner <andyfootner@netscape.net>
Co-authored-by: left23 <lcdemc@gmail.com>

* Deploy 04-12-2023 (#358) (#359)

* chore: Update all outdated drupal/* packages.

* CD-511 Samples module and PWA update (#344)

* feat: install Samples module, and update PWA due to bug while saving Samples permission

Refs: CD-511

* chore: enable Samples module

Refs: CD-511

* chore: set permissions for samples, pwa

Refs: CD-511

* Update local folder with most recent from unocha for consistency (#346)

* chore: uodate local folder with most recent from unocha for consistency

* chore: comment out contrib modules and themes from docker-compose as is standard

* CD-511 Follow up PWA module (#345)

* chore: enable pwa submodules and configure, add patch for missing labels

Refs: CD-511

* chore: remove leftover patch no longer referenced in patch file

Refs: CD-511

* chore: uodate local folder with most recent from unocha for consistency

* chore: more PWA config, disable one sub module as it is not needed

Refs: CD-511

* chore: comment out contrib modules and themes from docker-compose as is standard

* chore: add social_auth scope to config

Refs: CD-516

* chore: Update all outdated drupal/* packages.

* chore: update local stack for consistency

Refs: local-stack

* OPS-9885 Uninstall PWA (#355)

* chore: uninstall pwa

Refs: CD-511

* chore: remove pwa patch

Refs: OPS-9885

* chore: remove pwa from config

Refs: OPS-9885

* chore: update base theme to v9.2.2 (#356)

Refs: OPS-9885

* Automatic Composer Update (#354)

* chore: Update all outdated drupal/* packages.

* chore: update theme and bump versions of other modules

Refs: updates

---------




* chore: composer update

Refs: OPS-9885

* chore: remove pwa related config

Refs: OPS-9885

---------

Co-authored-by: unocha-jenkins <ops+github@reliefweb.int>
Co-authored-by: Andy Footner <andyfootner@netscape.net>

* chore: Update all outdated drupal/* packages.

* chore: change facet wiget from select_a11y to checkboxes, as select_a11y is not working (#361)

Refs: CD-511

* chore: Fix PHP82 for facets (#362)

* chore: Fix PHP82 for facets

* chore: Back to select_a11y_dropdown

* CD-511 default content (#353)

* feat: lighthouse GA workflow from UNOCHA

Refs: CD-511

* feat: demo content module with csv from unocha

Refs: CD-511

* chore: remove run-tests so lighthouse test are used instead

Refs: CD-511

* chore: run only if label is applied

Refs: CD-511

* chore: remove duplicate steps

Refs: CD-511

* chore: remove install sub theme step

Refs: CD-511

* chore: remove slack steps for ease

Refs: CD-511

* chore: remove sub theme step again

Refs: CD-511

* chore: remove reference to  permissions

Refs: CD-511

* chore: add debug before fail

Refs: CD-511

* chore: debug and remove run tests

Refs: CD-511

* chore: indentation so it runs

Refs: CD-511

* chore: update config for demo content module

Refs: CD-511

* chore: remove debug, notice no vendor directory

Refs: CD-511

* chore: curl 127

Refs: CD-511

* chore: tell nginx about custom port

Refs: CD-511

* chore: add port

Refs: CD-511

* chore: reduce to running on labeled only

Refs: CD-511

* chore: bring back previously failing starterkit tests

Refs: CD-511

* chore: test sh file and update tests docker-compose volume perms

Refs: CD-511

* chore: try it without usr bin

Refs: CD-511

* chore: subtheme script in composer

Refs: CD-511

* chore: Remove breaking line for now

Refs: CD-511

* chore: remove browser output for now

Refs: CD-511

* chore: update version of lighthouse actions

Refs: CD-511

* chore: path for lighthous rc

Refs: CD-511

* chore: path from site root

Refs: CD-511

* chore: re-add en demo module step and set perf urls in config

Refs: CD-511

* chore: urls plural

Refs: CD-511

* chore: urls back into yml

Refs: CD-511

* chore: use a live URL

Refs: CD-511

* chore: live url only

Refs: CD-511

* chore: run curl

Refs: CD-511

* chore: drush run server

Refs: CD-511

* chore: transfer run server to start server command in lighthouse

Refs: CD-511

* chore: Try default_content

* Do not delete the info file

* chore: Try default_content

* Enable aggregation

* Enable aggregation

* 3 runs

* chore: add menu items and custom blocks

Refs: CD-511

* chore: export menu items

Refs: CD-511

* chore: export custom blocks

Refs: CD-511

* chore: uninstall pwa

Refs: CD-511

* chore: adjust config to exclude pwa

Refs: CD-511

* chore: config_filter issue

Refs: CD-511

* chore: export content again, after removing some items that do not need to be there

Refs: CD-511

* chore: add UUIDs to reflect

Refs: CD-511

* chore: Docksal to PHP8.2

* Remove stale entities

* Cleanup

* Re-add landing page

* Re-add demo page

* Fix user ref

* test dependcy for menu links

* Log home page

* Fix homepage

* chore: Add patch to export menu links to node/123

* chore: Add patch to export menu links to node/123

* chore: export content from prod db, remove unneeded files and media entities

Refs: CD-511

* chore: reenable select_a11y as it is not an issue

Refs: CD-511

* chore: reset yml to run tests

Refs: CD-511

* chore: regen lock

Refs: CD-511

* set home uuid

* chore: replace node id block placement with path aliases

Refs: CD-511

* chore: delete entities before enabling the module to export more

Refs: CD-511

* chore: generate new content including 12 articles

Refs: CD-511

---------

Co-authored-by: left23 <lcdemc@gmail.com>

* OPS-9885 Remove PWA module (#363)

* chore: remove pwa

Refs: OPS-9885

* style: cs

Refs: OPS-9885

* chore: Update all outdated drupal/* packages.

* chore: Update all outdated drupal/* packages.

* chore: enable SDC plus deps

Refs: CD-483

* chore: Update all outdated drupal/* packages.

* chore: unblock updates

Refs: updates

* chore: migrate site's sub-theme to be SDC-ready

Refs: CD-483

* chore: Update all outdated drupal/* packages.

* chore(deps): bump common_design to 9.3.0

Refs: CD-483

* CD-511 Demo content and Github Actions (#348)

* feat: lighthouse GA workflow from UNOCHA

Refs: CD-511

* feat: demo content module with csv from unocha

Refs: CD-511

* chore: remove run-tests so lighthouse test are used instead

Refs: CD-511

* chore: run only if label is applied

Refs: CD-511

* chore: remove duplicate steps

Refs: CD-511

* chore: remove install sub theme step

Refs: CD-511

* chore: remove slack steps for ease

Refs: CD-511

* chore: remove sub theme step again

Refs: CD-511

* chore: remove reference to  permissions

Refs: CD-511

* chore: add debug before fail

Refs: CD-511

* chore: debug and remove run tests

Refs: CD-511

* chore: indentation so it runs

Refs: CD-511

* chore: update config for demo content module

Refs: CD-511

* chore: remove debug, notice no vendor directory

Refs: CD-511

* chore: curl 127

Refs: CD-511

* chore: tell nginx about custom port

Refs: CD-511

* chore: add port

Refs: CD-511

* chore: reduce to running on labeled only

Refs: CD-511

* chore: bring back previously failing starterkit tests

Refs: CD-511

* chore: test sh file and update tests docker-compose volume perms

Refs: CD-511

* chore: try it without usr bin

Refs: CD-511

* chore: subtheme script in composer

Refs: CD-511

* chore: Remove breaking line for now

Refs: CD-511

* chore: remove browser output for now

Refs: CD-511

* chore: update version of lighthouse actions

Refs: CD-511

* chore: path for lighthous rc

Refs: CD-511

* chore: path from site root

Refs: CD-511

* chore: re-add en demo module step and set perf urls in config

Refs: CD-511

* chore: urls plural

Refs: CD-511

* chore: urls back into yml

Refs: CD-511

* chore: use a live URL

Refs: CD-511

* chore: live url only

Refs: CD-511

* chore: run curl

Refs: CD-511

* chore: drush run server

Refs: CD-511

* chore: transfer run server to start server command in lighthouse

Refs: CD-511

* chore: update urls to test and set runs to 3

* chore: label-based conditional for performance tests

Refs: CD-511

* chore: rename to run-tests, indicating performance pieces are optional

Refs: CD-511

* chore: re-add portions previously removed while debuggin

Refs: CD-511

* chore: run tests on most PR conditions

Refs: CD-511

* chore: missing phpunit config

Ref: CD-511

* chore: phpunit config

Refs: CD-511

* chore: pre-pool-create composer from starterkit

Refs: CD-511

* chore: add phpunit as dev dependency

Refs: CD-511

* chore: regen lock

Refs: CD-511

* chore: composer defaults from starterkit

Refs: CD-511

* chore: fail false

Refs: CD-511

* chore: remove unit tests again

Refs: CD-511

* chore: update dockerfile from starterkit, add dev_mode

Refs: CD-511

* chore: add memcache service from starterkit

Refs: CD-511

* chore: remove memcache service and reference to file as module is not present

Refs: CD-511

* chore: reset dockerfile

Refs: CD-511

* chore: remove leftover files from previous module iteration

Refs: CD-511

* chore: phpunit is back

Refs: CD-511

* chore: add a test

Refs: CD-511

* style: cs

Refs: CD-511

* chore: phpunit config in the correct place

Refs: CD-511

* chore: remove --prefer-dist from composer install step

Refs: CD-511

* chore: allow plugins list from starterkit

Refs: CD-511

* chore: update composer and lock

Refs: CD-511

* chore: more composer and lock

Refs: CD-511

* chore: more dockerfile from starterkit

Refs: CD-511

* chore: no memcache

Refs: CD-511

* chore: properly formed composer file

Refs: CD-511

* chore: scripts and assets, regen lock FTW

Refs: CD-511

* chore: i dunno, remove it?

Refs: CD-511

* chore: docker file from starterkit

Refs: CD-511

* chore: bump mysql image in tests

Refs: OPS-9749

* chore: remove duplicate

Refs: CD-511

* chore: add e2e test step

Refs: CD-511

* chore: set up node step and add label for e2e

Refs: CD-511

* chore: update readme

Refs: CD-511

* chore: add urls and refine budget

Refs: CD-511

* chore: increase value for demo page

Refs: CD-511

* chore: test homepage, not all

Refs: CD-511

* chore: budget based on web core vitals

Refs: CD-511

* chore: add another page with its own budget

Refs: CD-511

* chore: URLs are in the test file

Refs: CD-511

* chore: bypass test error for now, install node, attempt to run e2e

Refs: CD-511

* chore: not cd

Refs: CD-511

* chore: still use composer script

Refs: CD-511

* chore: cache node modules and test -d

Refs: CD-511

* chore: still no cd and path to custom not contrib

Refs: CD-511

* chore: install node and checks

Refs: CD-511

* chore: cd to sub theme

Refs: CD-511

* chore: cache npm

Refs: CD-511

* chore: try dependency path as sub theme relative to gh dir

Refs: CD-511

* chore: run npm in same step as node set up

Refs: CD-511

* chore: no run in node set up

Refs: CD-511

* chore: test if node is available

Refs: CD-511

* chore: bypass composer script and set work dir

Refs: CD-511

* chore: remove ampersands

Refs: CD-511

* chore: reference docker

Refs: CD-511

* chore: try to get to subtheme dir

Refs: CD-511

* chore: proper commands would be nice

Refs: CD-511

* chore: plural

Refs: CD-511

* chore: npm install step

Refs: CD-511

* chore: run e2e

Refs: CD-511

* chore: node env and ci instead of travis

Refs: CD-511

* chore: set node env for ci in script

Refs: CD-511

* chore: re-enable php tests and disable cache

Refs: CD-511

* chore: remove sample db and readme as no longer used

Refs: CD-511

* chore: enable demo content so e2e tests pass

Refs: CD-511

* chore: reduce to only what is needed

Refs: CD-511

* CD-511 Github Actions and e2e (#368)

* chore: Update all outdated drupal/* packages.

* chore: unblock updates

Refs: updates

* chore: install node and checks

Refs: CD-511

* chore: cd to sub theme

Refs: CD-511

* chore: cache npm

Refs: CD-511

* chore: try dependency path as sub theme relative to gh dir

Refs: CD-511

* chore: run npm in same step as node set up

Refs: CD-511

* chore: no run in node set up

Refs: CD-511

* chore: test if node is available

Refs: CD-511

* chore: bypass composer script and set work dir

Refs: CD-511

* chore: remove ampersands

Refs: CD-511

* chore: reference docker

Refs: CD-511

* chore: try to get to subtheme dir

Refs: CD-511

* chore: proper commands would be nice

Refs: CD-511

* chore: plural

Refs: CD-511

* chore: npm install step

Refs: CD-511

* chore: run e2e

Refs: CD-511

* chore: node env and ci instead of travis

Refs: CD-511

* chore: set node env for ci in script

Refs: CD-511

* chore: re-enable php tests and disable cache

Refs: CD-511

* chore: remove sample db and readme as no longer used

Refs: CD-511

* chore: enable demo content so e2e tests pass

Refs: CD-511

* chore: reduce to only what is needed

Refs: CD-511

---------

Co-authored-by: unocha-jenkins <ops+github@reliefweb.int>
Co-authored-by: Andy Footner <andyfootner@netscape.net>

* chore: prevent running when labels are removed

Refs: CD-511

* chore: prevent running tests when PR descr is edited

Refs: CD-511

* chore: rename as tests as per starterkit

Refs: CD-511

* chore: remove theme compilation scripts from composer, no longer used

Refs: CD-511

* chore: re-add slack notifications and reorder

Refs: CD-511

* chore: reorder to better group tests

Refs: CD-511

* chore: regen lock

Refs: CD-511

* chore: regen lock smore

Ref: CD-511

* docs: add tests info to readme

Refs: CD-511

---------

Co-authored-by: Andy Footner <andyfootner@netscape.net>
Co-authored-by: unocha-jenkins <ops+github@reliefweb.int>

* chore: regen lock to resolve conflicts

Refs: OPS-9885

---------

Co-authored-by: unocha-jenkins <ops+github@reliefweb.int>
Co-authored-by: Andy Footner <andyfootner@netscape.net>
Co-authored-by: Peter Droogmans <peter@attiks.com>
Co-authored-by: Chris Ruppel <ruppel@reliefweb.int>
  • Loading branch information
5 people authored Jan 10, 2024
1 parent 381b97d commit 46b0c3c
Show file tree
Hide file tree
Showing 88 changed files with 14,357 additions and 4,464 deletions.
2 changes: 1 addition & 1 deletion .docksal/docksal.env
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ DOCKSAL_STACK=default
# This will prevent images from being updated when Docksal is updated
#WEB_IMAGE='docksal/web:x.x-apache2.4'
#DB_IMAGE='docksal/db:x.x-mysql-5.6'
#CLI_IMAGE='docksal/cli:x.x-php7.1'
CLI_IMAGE='docksal/cli:php8.2-build'

# Override virtual host (matches project folder name by default)
#VIRTUAL_HOST=drupal8.docksal
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/lighthouse-budget.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
[
{
"path": "/",
"timings": [
{
"metric": "largest-contentful-paint",
"budget": 4000
},
{
"metric": "max-potential-fid",
"budget": 300
},
{
"metric": "interactive",
"budget": 5000
},
{
"metric": "cumulative-layout-shift",
"budget": 0.25
}
],
"resourceSizes": [
{
"resourceType": "document",
"budget": 60
},
{
"resourceType": "script",
"budget": 150
},
{
"resourceType": "stylesheet",
"budget": 30
},
{
"resourceType": "total",
"budget": 700
}
]
},
{
"path": "/demo",
"timings": [
{
"metric": "largest-contentful-paint",
"budget": 5000
},
{
"metric": "max-potential-fid",
"budget": 400
},
{
"metric": "interactive",
"budget": 6000
},
{
"metric": "cumulative-layout-shift",
"budget": 0.35
}
]
}
]
16 changes: 16 additions & 0 deletions .github/workflows/lighthouserc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
ci: {
collect: {
startServerCommand: 'docker compose -f tests/docker-compose.yml exec -T drupal drush rs 127.0.0.1:8080'
},
assert: {
preset: "lighthouse:recommended",
assertions: {
"first-contentful-paint": ["error", {"minScore": 0.6}]
}
},
upload: {
target: "temporary-public-storage",
},
},
};
122 changes: 109 additions & 13 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
name: Run tests

on: [pull_request]
on:
pull_request:
types: [labeled, opened, synchronize]

jobs:
tests:
runs-on: ubuntu-latest
permissions:
contents: write
checks: write
pull-requests: write
actions: read
statuses: write

steps:
- name: Checkout Code
Expand Down Expand Up @@ -64,8 +59,7 @@ jobs:
uses: cafuego/command-output@main
with:
run: |
# Uncomment this if we have custom modules.
# test ! -d ./html/modules/custom || find -L ./html/modules/custom -iregex '.*\.\(php\|module\|inc\|install\)$' -print0 | xargs -0 -n 1 -P 4 php -l
test ! -d ./html/modules/custom || find -L ./html/modules/custom -iregex '.*\.\(php\|module\|inc\|install\)$' -print0 | xargs -0 -n 1 -P 4 php -l
test ! -d ./html/themes/custom || find -L ./html/themes/custom -iregex '.*\.\(php\|theme\)$' -print0 | xargs -0 -n 1 -P 4 php -l
env:
fail-fast: true
Expand Down Expand Up @@ -111,12 +105,19 @@ jobs:
env:
fail-fast: true

- name: Install Subtheme
id: subtheme
uses: cafuego/command-output@main
with:
run: |
docker compose -f tests/docker-compose.yml exec -w /srv/www -T drupal /usr/bin/composer run sub-theme
- name: PHPCS
id: phpcs
uses: cafuego/command-output@main
with:
run: |
docker compose -f tests/docker-compose.yml exec -u appuser -w /srv/www -T drupal phpcs -p --report=full --standard=phpcs.xml ./html/themes/custom
docker compose -f tests/docker-compose.yml exec -u appuser -w /srv/www -T drupal phpcs -p --report=full --standard=phpcs.xml ./html/modules/custom ./html/themes/custom
env:
fail-fast: true

Expand All @@ -125,12 +126,107 @@ jobs:
uses: cafuego/command-output@main
with:
run: |
# This isn't very useful as we're not actually running tests.
docker compose -f tests/docker-compose.yml exec -T drupal drush -y si --existing-config
docker compose -f tests/docker-compose.yml exec -T drupal drush -y si --existing-config minimal install_configure_form.enable_update_status_emails=NULL
env:
fail-fast: true

- name: Run tests
id: tests
uses: cafuego/command-output@main
with:
run: |
docker compose -f tests/docker-compose.yml exec -T drupal drush -y en dblog
docker compose -f tests/docker-compose.yml exec -T drupal chmod -R 777 /srv/www/html/sites/default/files /srv/www/html/sites/default/private
docker compose -f tests/docker-compose.yml exec -T drupal mkdir -p /srv/www/html/build/logs
docker compose -f tests/docker-compose.yml exec -T drupal chmod -R 777 /srv/www/html/build/logs
docker-compose -f tests/docker-compose.yml exec -T drupal mkdir -p /srv/www/html/build/logs /srv/www/html/sites/default/files/browser_output
docker-compose -f tests/docker-compose.yml exec -T drupal chmod -R 777 /srv/www/html/build/logs /srv/www/html/sites/default/files/browser_output
docker compose -f tests/docker-compose.yml exec -T -w /srv/www -e XDEBUG_MODE=coverage -e BROWSERTEST_OUTPUT_DIRECTORY=/srv/www/html/sites/default/files/browser_output -e DTT_BASE_URL=http://127.0.0.1 drupal ./vendor/bin/phpunit --coverage-clover /srv/www/html/build/logs/clover.xml --debug
env:
fail-fast: true

- name: Copy Coveralls
id: copy_coveralls
if: success()
run: docker cp "$(docker compose -f tests/docker-compose.yml ps -q drupal)":/srv/www/html/build/logs/clover.xml . || echo "skip=true" >> "$GITHUB_OUTPUT"

- name: Monitor coverage
id: coveralls
if: ${{ steps.copy_coveralls.outputs.skip != 'true' }}
uses: slavcodev/coverage-monitor-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
coverage_path: "clover.xml"
threshold_alert: 0
threshold_warning: 50
threshold_metric: "lines"
comment_footer: false

- name: Install demo content
# Install Demo content if the PR has the label "e2e" or "performance"
if: contains(github.event.pull_request.labels.*.name, 'e2e') || contains(github.event.pull_request.labels.*.name, 'performance')
id: content
uses: cafuego/command-output@main
with:
run: |
docker-compose -f tests/docker-compose.yml exec -T drupal drush -y en unocha_demo_content
curl -v http://127.0.0.1:8080/demo
env:
fail-fast: true

- name: Set up node
# Run Jest e2e tests if the PR has the label "e2e"
if: contains(github.event.pull_request.labels.*.name, 'e2e')
uses: actions/setup-node@v4
with:
node-version: '^18.16.1'

- name: Install node dependencies
# Run Jest e2e tests if the PR has the label "e2e"
if: contains(github.event.pull_request.labels.*.name, 'e2e')
run: |
docker compose -f tests/docker-compose.yml exec -w /srv/www drupal sh
cd html/themes/custom/common_design_subtheme
npm install
- name: Run e2e tests
# Run Jest e2e tests if the PR has the label "e2e"
if: contains(github.event.pull_request.labels.*.name, 'e2e')
run: |
docker compose -f tests/docker-compose.yml exec -w /srv/www drupal sh
cd html/themes/custom/common_design_subtheme
npm run ci -- -t '^(?!.*Subtheme).*$'
env:
fail-fast: true

# - name: Debug Server
# uses: cafuego/command-output@main
# with:
# run: |
# docker ps -a

- name: Audit URLs using Lighthouse
# Run Lighthouse if the PR has the label "performance"
if: contains(github.event.pull_request.labels.*.name, 'performance')
uses: treosh/lighthouse-ci-action@10.1.0
with:
urls: |
http://127.0.0.1:8080/
http://127.0.0.1:8080/demo
runs: 3
budgetPath: .github/workflows/lighthouse-budget.json # test performance budgets
configPath: .github/workflows/lighthouserc.js
uploadArtifacts: true # save results as an action artifacts
temporaryPublicStorage: true # upload lighthouse report to the temporary storage

- name: DB Logs
id: dblog
if: failure()
uses: cafuego/command-output@main
with:
run: |
docker compose -f tests/docker-compose.yml exec -T drupal drush watchdog:show
- name: Find Comment
uses: peter-evans/find-comment@v2
if: ${{ !env.ACT }}
Expand Down
38 changes: 34 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Common Design Demo | [![Build Status](https://travis-ci.com/UN-OCHA/common-design-site.svg?branch=master)](https://travis-ci.com/UN-OCHA/common-design-site)
# Common Design Demo

This is the Common Design Drupal 8 site. The code for this project is managed with composer.
This is the Common Design Drupal 10 site. The code for this project is managed with composer.

To install security updates for Drupal, run `composer update drupal/core drupal/core-dev --with-dependencies`.

Expand Down Expand Up @@ -29,9 +29,11 @@ and stage_file_proxy.

### Remote

Automatic testing is run via Travis CI. Code syntax, style and quality are inspected.
Automatic testing is run via GitHub Actions.
Code syntax, style and quality are inspected by default, based on [drupal-starterkit run-tests.yml](https://github.com/UN-OCHA/drupal-starterkit/blob/develop/.github/workflows/run-tests.yml)

With a small alteration, these tests could run via GitHub Actions.
To run Lighthouse tests, add the label "performance" to the PR.
To run end-to-end test with Jest, add the label "e2e" to the PR.

### Locally

Expand Down Expand Up @@ -79,3 +81,31 @@ fin composer outdated drupal/*
fin composer update drupal/* --with-dependencies
fin drush updb -y && fin drush cr
```

### Set up with local stack
See [/local/README](https://github.com/UN-OCHA/common-design-site/tree/develop/local)

## Performance or e2e tests with Github Actions
Optional test steps - see `run-tests.yml`

Custom Github labels need to be applied to the PR for the above test steps to run: `performance` or `e2e` depending.

### Install demo content

Enables unocha_demo_content module and imports nodes, menu items etc from json, set the frontpage

### Set up node

Github action to install node

### Install node dependencies

In sub theme, install packages including Jest for e2e

### Run e2e tests

Runs Jest e2e tests in sub theme using as ci at http://127.0.0.1:8080

### Audit URLs using Lighthouse

Runs multiple times on 2 URLS (http://127.0.0.1:8080 and http://127.0.0.1:8080/demo) against a performance budget and provides temporary links to Lighthouse reports.
31 changes: 31 additions & 0 deletions assets/docker-build-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build docker image

on:
push:
branches:
- develop
- 'feature/**'
- main
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
steps:

- name: Build
id: build-action
uses: UN-OCHA/actions/drupal-docker-build@main
with:
aws_access_key_id: ${{ secrets.ECR_AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.ECR_AWS_ACCESS_KEY_ID }}
docker_registry_url: public.ecr.aws
docker_registry_path: /unocha/
docker_image: starterkit-site
docker_username: ${{ secrets.ECR_AWS_ACCESS_KEY_ID }}
docker_password: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }}
ecr_github_token: ${{ secrets.ECR_GITHUB_TOKEN }}
ecr_jenkins_token: ${{ secrets.JENKINS_ECR_TOKEN }}
slack_bot_token: ${{ secrets.SLACK_BOT_TOKEN }}
slack_channel_name: ${{ secrets.SLACK_CHANNEL }}
1 change: 1 addition & 0 deletions assets/robots.txt.append
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Sitemap
Loading

0 comments on commit 46b0c3c

Please sign in to comment.