Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: YAML anchors to minimize redundancy #791

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 61 additions & 57 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,65 +22,69 @@ before_install:
- export PATH="$HOME/.config/composer/vendor/bin:$PATH"
git:
depth: 500

.setup_ddev: &setup_ddev
- "(travis_retry $TRAVIS_BUILD_DIR/ci-scripts/install_ddev.sh) || travis_terminate 1;"
- "$TRAVIS_BUILD_DIR/ci-scripts/install_drupal.sh || travis_terminate 1;"
- "$TRAVIS_BUILD_DIR/ci-scripts/test_phpunit.sh || travis_terminate 1;"

.deploy_prep: &deploy_prep
- "(travis_retry $TRAVIS_BUILD_DIR/ci-scripts/prepare_deploy.sh) || travis_terminate 1;"
- ddev composer install || travis_terminate 1;

jobs:
allow_failures:
env:
- CAN_FAIL=true
include:
- stage: Lint
name: PhpStan
script:
- "$TRAVIS_BUILD_DIR/ci-scripts/test_syntax.sh || travis_terminate 1;"
- composer install
- vendor/bin/phpstan analyse -c phpstan.neon
- stage: Lint
name: Drupal coding standard
script:
- composer install || travis_terminate 1;
- vendor/bin/robo phpcs || travis_terminate 1;
- stage: Lint
name: 'Shell coding standard: shellcheck'
script:
- "$TRAVIS_BUILD_DIR/ci-scripts/install_shell.sh || travis_terminate 1;"
- "$TRAVIS_BUILD_DIR/ci-scripts/test_shell.sh || travis_terminate 1;"
- stage: Test
name: 'Backend tests: Functional tests'
if: (branch != "main" AND tag IS blank)
script:
- "(travis_retry $TRAVIS_BUILD_DIR/ci-scripts/install_ddev.sh) || travis_terminate 1;"
- "$TRAVIS_BUILD_DIR/ci-scripts/install_drupal.sh || travis_terminate 1;"
- "$TRAVIS_BUILD_DIR/ci-scripts/test_phpunit.sh || travis_terminate 1;"
- "$TRAVIS_BUILD_DIR/ci-scripts/test_phpunit_rollbar.sh || travis_terminate 1;"
- stage: Deploy
env: CAN_FAIL=true
name: 'Backend tests: Functional tests and deploy to Pantheon QA'
if: branch = "main" AND type = push AND tag IS blank
script:
- "(travis_retry $TRAVIS_BUILD_DIR/ci-scripts/install_ddev.sh) || travis_terminate 1;"
- "$TRAVIS_BUILD_DIR/ci-scripts/install_drupal.sh || travis_terminate 1;"
- "$TRAVIS_BUILD_DIR/ci-scripts/test_phpunit.sh || travis_terminate 1;"
- "(travis_retry $TRAVIS_BUILD_DIR/ci-scripts/prepare_deploy.sh) || travis_terminate 1;"
- "(travis_retry ddev robo deploy:pantheon qa --no-interaction) || travis_terminate 1;"
- ddev composer install || travis_terminate 1;
- ddev robo deploy:notify || travis_terminate 1;
- stage: Deploy
name: 'Backend tests: Functional tests and deploy to Pantheon TEST'
if: tag IS present AND type = "push" AND tag !~ /live$/
script:
- "(travis_retry $TRAVIS_BUILD_DIR/ci-scripts/install_ddev.sh) || travis_terminate 1;"
- "$TRAVIS_BUILD_DIR/ci-scripts/install_drupal.sh || travis_terminate 1;"
- "$TRAVIS_BUILD_DIR/ci-scripts/test_phpunit.sh || travis_terminate 1;"
- "(travis_retry $TRAVIS_BUILD_DIR/ci-scripts/prepare_deploy.sh) || travis_terminate 1;"
- "(travis_retry ddev robo deploy:tag-pantheon --no-interaction $TRAVIS_TAG master) || travis_terminate 1;"
- ddev composer install || travis_terminate 1;
- "(travis_retry ddev robo deploy:pantheon-sync) || travis_terminate 1;"
- stage: Deploy
name: 'Backend tests: Functional tests and deploy to Pantheon LIVE'
if: tag IS present AND type = "push" AND tag =~ /live$/
script:
- "$TRAVIS_BUILD_DIR/ci-scripts/check_live_deploy.sh || travis_terminate 1;"
- "(travis_retry $TRAVIS_BUILD_DIR/ci-scripts/install_ddev.sh) || travis_terminate 1;"
- "$TRAVIS_BUILD_DIR/ci-scripts/install_drupal.sh || travis_terminate 1;"
- "$TRAVIS_BUILD_DIR/ci-scripts/test_phpunit.sh || travis_terminate 1;"
- "(travis_retry $TRAVIS_BUILD_DIR/ci-scripts/prepare_deploy.sh) || travis_terminate 1;"
- "(travis_retry ddev robo deploy:pantheon-sync live) || travis_terminate 1;"
- stage: Lint
name: PhpStan
script:
- "$TRAVIS_BUILD_DIR/ci-scripts/test_syntax.sh || travis_terminate 1;"
- composer install
- vendor/bin/phpstan analyse -c phpstan.neon

- stage: Lint
name: Drupal coding standard
script:
- composer install || travis_terminate 1;
- vendor/bin/robo phpcs || travis_terminate 1;

- stage: Lint
name: 'Shell coding standard: shellcheck'
script:
- "$TRAVIS_BUILD_DIR/ci-scripts/install_shell.sh || travis_terminate 1;"
- "$TRAVIS_BUILD_DIR/ci-scripts/test_shell.sh || travis_terminate 1;"

- stage: Test
name: 'Backend tests: Functional tests'
if: (branch != "main" AND tag IS blank)
script: *setup_ddev

- stage: Deploy
env: CAN_FAIL=true
name: 'Backend tests: Functional tests and deploy to Pantheon QA'
if: branch = "main" AND type = push AND tag IS blank
script:
- *setup_ddev
- *deploy_prep
- "(travis_retry ddev robo deploy:pantheon qa --no-interaction) || travis_terminate 1;"
- ddev robo deploy:notify || travis_terminate 1;

- stage: Deploy
name: 'Backend tests: Functional tests and deploy to Pantheon TEST'
if: tag IS present AND type = "push" AND tag !~ /live$/
script:
- *setup_ddev
- *deploy_prep
- "(travis_retry ddev robo deploy:tag-pantheon --no-interaction $TRAVIS_TAG master) || travis_terminate 1;"
- "(travis_retry ddev robo deploy:pantheon-sync) || travis_terminate 1;"

- stage: Deploy
name: 'Backend tests: Functional tests and deploy to Pantheon LIVE'
if: tag IS present AND type = "push" AND tag =~ /live$/
script:
- "$TRAVIS_BUILD_DIR/ci-scripts/check_live_deploy.sh || travis_terminate 1;"
- *setup_ddev
- *deploy_prep
- "(travis_retry ddev robo deploy:pantheon-sync live) || travis_terminate 1;"