-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UHF-9348: Merge branch 'main' of https://github.com/City-of-Helsinki/…
…drupal-hdbt into UHF-9348
- Loading branch information
Showing
4 changed files
with
36 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,26 @@ | ||
on: | ||
pull_request: | ||
types: [opened, reopened, synchronize] | ||
types: [opened, reopened, synchronize, ready_for_review] | ||
branches-ignore: | ||
- 'renovate/**' | ||
push: | ||
branches: | ||
- main | ||
env: | ||
SIMPLETEST_DB: mysql://drupal:drupal@db:3306/drupal | ||
name: Visual regression tests | ||
|
||
concurrency: | ||
group: visual-regression | ||
|
||
jobs: | ||
tests: | ||
if: github.event.pull_request.draft == false | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
fetch-depth: 0 | ||
|
||
- name: Set variables | ||
run: echo "DRUPAL_ROOT=$HOME/drupal" >> $GITHUB_ENV | ||
|
@@ -43,7 +50,7 @@ jobs: | |
COMPOSER_MIRROR_PATH_REPOS: 1 | ||
run: | | ||
composer config repositories.5 path $GITHUB_WORKSPACE | ||
composer require drupal/$THEME_NAME -W | ||
composer require drupal/redis drupal/$THEME_NAME -W | ||
# We use COMPOSER_MIRROR_PATH_REPOS=1 to mirror local repository | ||
# instead of symlinking it to make sure the code is available inside | ||
# the app container. | ||
|
@@ -77,6 +84,7 @@ jobs: | |
if: steps.drupal-cache.outputs.cache-hit != 'true' | ||
run: | | ||
docker compose exec app bash -c "drush si minimal -y" | ||
docker compose exec app bash -c "drush en redis -y" | ||
docker compose exec app bash -c "drush en helfi_test_content -y" | ||
docker compose exec app bash -c "drush sql-dump --result-file=/app/public/sites/default/files/latest.sql" | ||
|
@@ -134,22 +142,19 @@ jobs: | |
run: docker compose logs app > /tmp/container.log | ||
|
||
- name: Deploy to PR preview | ||
uses: peaceiris/actions-gh-pages@v3 | ||
uses: peaceiris/actions-gh-pages@v4 | ||
if: github.ref != 'refs/heads/main' | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ${{ env.THEME_FOLDER }}/backstop_data/full/ | ||
destination_dir: pull/${{github.event.number}} | ||
|
||
- name: Update comment | ||
uses: hasura/[email protected] | ||
if: github.ref != 'refs/heads/main' | ||
uses: thollander/actions-comment-pull-request@v2 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
repository: ${{ github.repository }} | ||
number: ${{ github.event.number }} | ||
id: deploy-preview | ||
recreate: true | ||
comment_tag: status | ||
pr_number: ${{ github.event.number }} | ||
message: "${{join(steps.run-tests.outputs.*, ' ')}}" | ||
|
||
- name: Upload container logs | ||
|
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