forked from Gizra/drupal-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.template.yml
62 lines (57 loc) · 2.33 KB
/
.travis.template.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
version: ~> 1.0
sudo: required
language: php
dist: focal
php:
- 8.0
services:
- docker
stages:
- lint
- test
- deploy
env:
global:
- PANTHEON_GIT_URL="{{ PANTHEON_GIT_URL }}"
before_install:
- export PATH="$HOME/.config/composer/vendor/bin:$PATH"
jobs:
include:
- stage: Lint
name: "PhpStan"
script:
- "composer install"
- "vendor/bin/phpstan analyse -c phpstan.neon"
- stage: Lint
name: "Drupal coding standard: phpcs"
script:
- "$TRAVIS_BUILD_DIR/ci-scripts/install_coder.sh || travis_terminate 1;"
- "export REVIEW_STANDARD=\"Drupal\" && $TRAVIS_BUILD_DIR/ci-scripts/test_coder.sh"
- stage: Lint
name: "Drupal coding best practices: phpcs"
script:
- "$TRAVIS_BUILD_DIR/ci-scripts/install_coder.sh || travis_terminate 1;"
- "export REVIEW_STANDARD=\"DrupalPractice\" && $TRAVIS_BUILD_DIR/ci-scripts/test_coder.sh"
- 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"
# Before auto-deploy gets configured, this will execute the tests always.
if: (branch != "{{ GITHUB_DEPLOY_BRANCH }}" AND tag IS blank) OR env(TERMINUS_TOKEN) IS blank
script:
- "$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;"
- stage: Deploy
name: "Backend tests: Functional tests and deploy to Pantheon"
# This will get activated using ddev robo deploy:config-autodeploy.
if: branch = "{{ GITHUB_DEPLOY_BRANCH }}" AND type = push AND env(TERMINUS_TOKEN) IS present
script:
- "$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 --no-interaction {{ PANTHEON_DEPLOY_BRANCH }}"