-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update branch with changes from develop
Refs: OPS-7872
- Loading branch information
1 parent
25eccaf
commit 9548a6a
Showing
309 changed files
with
11,374 additions
and
25,433 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
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
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
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
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
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,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 | ||
} | ||
] | ||
} | ||
] |
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,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", | ||
}, | ||
}, | ||
}; |
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 |
---|---|---|
@@ -1,15 +1,22 @@ | ||
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 | ||
id: checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Extract PHP Version | ||
id: php | ||
|
@@ -58,16 +65,15 @@ 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 | ||
|
||
- name: Configure AWS Credentials | ||
id: aws | ||
if: ${{ !env.ACT }} | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-access-key-id: ${{ secrets.ECR_AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }} | ||
|
@@ -76,10 +82,10 @@ jobs: | |
- name: Login to Public ECR | ||
id: aws-login | ||
if: ${{ !env.ACT }} | ||
uses: docker/login-action@v2.1.0 | ||
uses: docker/login-action@v3.0.0 | ||
with: | ||
registry: public.ecr.aws | ||
username: ${{ secrets.ECR_AWS_ACCESS_KEY_I }} | ||
username: ${{ secrets.ECR_AWS_ACCESS_KEY_ID }} | ||
password: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }} | ||
env: | ||
AWS_REGION: us-east-1 | ||
|
@@ -105,12 +111,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 | ||
|
||
|
@@ -119,27 +132,122 @@ 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' | ||
|
||
- 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/[email protected] | ||
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 | ||
uses: peter-evans/find-comment@v3 | ||
if: ${{ !env.ACT }} | ||
id: fc | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
issue-number: ${{ github.event.pull_request.number }} | ||
comment-author: 'github-actions[bot]' | ||
body-includes: Build output | ||
|
||
- name: Create or update comment | ||
uses: peter-evans/create-or-update-comment@v2 | ||
uses: peter-evans/create-or-update-comment@v4 | ||
if: ${{ !env.ACT }} | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
comment-id: ${{ steps.fc.outputs.comment-id }} | ||
issue-number: ${{ github.event.pull_request.number }} | ||
body: | | ||
|
@@ -164,9 +272,9 @@ jobs: | |
- name: Slack Success Notification | ||
id: slack_success | ||
if: ${{ !env.ACT && success() }} | ||
uses: slackapi/slack-github-action@v1.23.0 | ||
uses: slackapi/slack-github-action@v1.25.0 | ||
with: | ||
channel-id: '${{ secrets.SLACK_CHANNEL }}' | ||
channel-id: '${{ vars.SLACK_CHANNEL }}' | ||
payload: | | ||
{ | ||
"text": "Tests passed for a pull request on ${{ github.repository }}", | ||
|
@@ -191,9 +299,9 @@ jobs: | |
- name: Slack Failure Notification | ||
id: slack_failure | ||
if: ${{ !env.ACT && failure() }} | ||
uses: slackapi/slack-github-action@v1.23.0 | ||
uses: slackapi/slack-github-action@v1.25.0 | ||
with: | ||
channel-id: '${{ secrets.SLACK_CHANNEL }}' | ||
channel-id: '${{ vars.SLACK_CHANNEL }}' | ||
payload: | | ||
{ | ||
"text": "Tests failed for a pull request on ${{ github.repository }}", | ||
|
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
Oops, something went wrong.