-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
68 lines (55 loc) · 2.25 KB
/
.travis.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
63
64
65
66
67
68
dist: jammy
language: php
php:
- 8.1
node_js:
- "16"
- "18"
env:
matrix:
- DRUPAL=9.4 PHPUNIT=9
- DRUPAL=9.5 PHPUNIT=9
jobs:
fast_finish: true
cache:
directories:
- $HOME/.composer/cache
before_install:
# Install various packages.
- nvm install 18 && nvm use 18
- npm install -g gulp-cli
# Update composer to latest v2.
- composer self-update --2
- composer --version
# Configure the repository authentication mechanisms.
- if [ "${GITHUB_TOKEN}" != "" ]; then composer config github-oauth.github.com ${GITHUB_TOKEN}; fi
- if [ "${REPMAN_TOKEN}" != "" ]; then composer config --global --auth http-basic.district09.repo.repman.io token ${REPMAN_TOKEN}; fi
- if [ "${REPMAN_TOKEN}" != "" ]; then composer config repositories.repman-district09 composer https://district09.repo.repman.io; fi
# Get and run the Code Climate test reporter.
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
install:
# Set the proper Drupal core & PHPUnit version.
- composer require -n --no-update --sort-packages --dev --with-all-dependencies "drupal/core:~$DRUPAL.0" "phpunit/phpunit:^$PHPUNIT" "drupal/paragraphs:^1.12" "drupal/webform:^6.0" "gent-drupal/dg_vesta:^1.0"
# Install the module dependencies.
- composer install -n --no-progress
script:
- vendor/bin/grumphp run -n
- cd source && gulp validate && cd ..
after_script:
# Run the Code Climate test reporter.
- ./cc-test-reporter after-build --coverage-input-type clover --exit-code $TRAVIS_TEST_RESULT
# Get and run the SonarQube scanner.
- SONAR_PROJECT_NAME="Drupal $(composer config name | cut -d / -f 2)"
- SONAR_PROJECT_KEY=web:$(echo "$TRAVIS_REPO_SLUG" | cut -d / -f 2)
- curl -L https://repo1.maven.org/maven2/org/sonarsource/scanner/cli/sonar-scanner-cli/4.3.0.2102/sonar-scanner-cli-4.3.0.2102.jar > sonar-scanner.jar
- "[ -d tests ] || mkdir tests"
- >
java -jar sonar-scanner.jar
-Dsonar.host.url=https://sonarqube.stad.gent
-Dsonar.login=$SONAR_LOGIN
-Dsonar.projectKey=$SONAR_PROJECT_KEY
-Dsonar.projectName="$SONAR_PROJECT_NAME"
-Dsonar.tests=tests
-Dsonar.php.coverage.reportPaths=build/logs/clover.xml