This repository has been archived by the owner on Mar 25, 2024. It is now read-only.
Update dependencies of drupal/sparkpost #627
Workflow file for this run
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
name: "Build, Test & Deploy" | |
on: | |
pull_request_target: | |
types: | |
- opened | |
- edited | |
- synchronize | |
- reopened | |
- ready_for_review | |
env: | |
branch_name: ${{ github.head_ref || github.ref_name }} | |
jobs: | |
build: | |
name: "Build and test" | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
concurrency: | |
group: ${{ github.event.pull_request.number || github.ref }}-build | |
cancel-in-progress: true | |
steps: | |
- name: Check out the repository code | |
uses: actions/checkout@v3 | |
- name: Setup and start DDEV | |
uses: ddev/github-action-setup-ddev@v1 | |
- name: Provide information | |
run: | | |
echo "- Docker info" | |
docker info | |
echo "- Docker images" | |
docker images | |
echo "- DDEV information" | |
ddev version | |
echo "- PHP information" | |
ddev php --version | |
echo "- Composer information" | |
ddev composer --version | |
- name: Validate composer.json and composer.lock | |
run: ddev composer validate --strict | |
- name: Composer install | |
run: | | |
if [[ ${{ env.branch_name }} == "master" ]]; then | |
ddev composer install --no-dev --no-interaction --optimize-autoloader | |
else | |
ddev composer install --no-interaction --optimize-autoloader | |
fi | |
- name: Create symlinks | |
run: | | |
if [ ! -d html/sites/default/files ]; then | |
mkdir -pm 755 html/sites/default/files | |
fi | |
if [ ! -d html/sites/default/files/translations ]; then | |
mkdir -pm 755 html/sites/default/files/translations | |
fi | |
if [ ! -d html/sites/default/private ]; then | |
mkdir -pm 755 html/sites/default/private | |
fi | |
- name: Download and import the sanitized database | |
run: ddev composer import-sanitized | |
- name: Run drush deploy commands | |
run: ddev drush deploy | |
- name: Enable stage_file_proxy | |
run: | | |
if [[ ${{ env.branch_name }} == "master" ]]; then | |
composer require --dev drupal/stage_file_proxy | |
fi | |
ddev drush pm:enable stage_file_proxy --yes | |
ddev drush config:set stage_file_proxy.settings origin "https://www.drupalnorge.no" --yes | |
ddev drush config:set stage_file_proxy.settings hotlink true --yes | |
- name: Run test | |
run: ddev composer test | |
- name: Screenshots permissions | |
run: '(test -d screenshots && sudo chmod -R 777 screenshots) || echo "No screenshots found"' | |
if: ${{ failure() }} | |
- name: Upload screenshots | |
uses: actions/upload-artifact@v3 | |
if: ${{ failure() }} | |
with: | |
name: screenshots | |
path: screenshots | |
- name: Disable stage_file_proxy | |
run: | | |
ddev drush pm:uninstall stage_file_proxy --yes | |
ddev drush cache:rebuild | |
if [[ ${{ env.branch_name }} == "master" ]]; then | |
composer remove --dev drupal/stage_file_proxy | |
fi | |
- name: Sanitized database | |
run: | | |
ddev drush sql:sanitize --yes | |
- name: Database dump | |
run: ddev drush sql:dump > html/sanitized.db | |
- name: Upload the sanitized database | |
uses: actions/upload-artifact@v3 | |
if: ${{ success() }} | |
with: | |
name: sanitized.db | |
path: html/sanitized.db | |
if-no-files-found: error | |
- name: Creating an artifact | |
if: ${{ success() }} | |
run: > | |
tar | |
--exclude="./html/sites/default/files/*" | |
--exclude="./html/sites/default/private/*" | |
--exclude="./html/sites/default/.gitignore" | |
--exclude="./html/sites/default/settings.ddev.php" | |
-zcvf /tmp/artifact.tar.gz | |
./.ddev/config.yaml | |
./.ddev/docker-compose.chromedriver.yaml | |
./.git | |
./.github | |
./bin | |
./config | |
./drush | |
./html | |
./tests | |
./vendor | |
./.editorconfig | |
./.gitattributes | |
./.gitignore | |
./behat.yml.dist | |
./composer.json | |
./composer.lock | |
./phpcs.xml.dist | |
./README.md | |
- name: Uploading artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: artifact | |
path: /tmp/artifact.tar.gz | |
if-no-files-found: error |