Skip to content

Update Travis PHP jobs #946

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

Merged
merged 12 commits into from
Dec 6, 2019
Merged
Show file tree
Hide file tree
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
36 changes: 21 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,18 @@ branches:

# Before install, failures in this section will result in build status 'errored'
before_install:
- nvm install
- npm ci
- docker run --rm -v "$PWD:/app" composer install
- |
if [[ "$PHP" == "1" ]] || [[ "$JS" == "1" ]] || [[ "$SNIFF" == "1" ]]; then
npm install -g gulp-cli
if [[ "$JS" == "1" ]] || [[ "$E2E" == "1" ]] || [[ "$SNIFF" == "1" ]]; then
nvm install
npm ci
fi
- |
if [[ "$PHP" == "1" ]] || [[ "$E2E" == "1" ]] || [[ "$SNIFF" == "1" ]]; then
docker run --rm -v "$PWD:/app" composer install
fi
- |
if [[ "$JS" == "1" ]]; then
docker run --rm -v "$PWD:/app" composer install --no-scripts
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for these optimizations!

fi
- |
if [[ "$WP_VERSION" == "latest" ]]; then
Expand All @@ -62,7 +68,7 @@ before_install:
script:
- |
if [[ "$SNIFF" == "1" ]]; then
gulp phpcs || exit 1
composer lint || exit 1
npm run lint:js || exit 1
npm run lint:css || exit 1
fi
Expand All @@ -75,7 +81,7 @@ script:
fi
- |
if [[ "$PHP" == "1" ]]; then
gulp phpunit || exit 1
composer test || exit 1
fi
- |
if [[ "$E2E" == "1" ]]; then
Expand All @@ -87,7 +93,7 @@ script:

jobs:
allow_failures:
- php: 7.4snapshot
- php: nightly
include:
- stage: test
name: Lint
Expand All @@ -96,18 +102,18 @@ jobs:
- name: PHP Tests (PHP 5.6, WordPress latest)
php: 5.6
env: WP_VERSION=latest PHP=1 PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
- name: PHP Tests (PHP 7.3, WordPress latest)
php: 7.3
- name: PHP Tests (PHP 7.4, WordPress latest)
php: 7.4
env: WP_VERSION=latest PHP=1 PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
- name: PHP Tests (PHP 7.3, WordPress Multisite latest)
php: 7.3
- name: PHP Tests (PHP 7.4, WordPress Multisite latest)
php: 7.4
env: WP_VERSION=latest WP_MULTISITE=1 PHP=1 PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
- name: JS Tests
php: 7.3
php: 7.4
env: WP_VERSION=latest JS=1
- name: PHP Tests (PHP 7.4, WordPress trunk)
- name: PHP Tests (PHP nightly, WordPress trunk)
stage: test
php: 7.4snapshot
php: nightly
env: WP_VERSION=master PHP=1 PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
- stage: test
name: E2E Tests (WordPress latest)
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@
"@composer --working-dir=php-scoper config prefer-stable true",
"@composer --working-dir=php-scoper require humbug/php-scoper"
],
"lint": "vendor/bin/phpcs",
"lint-fix": "vendor/bin/phpcbf"
"lint": "phpcs",
"lint-fix": "phpcbf",
"test": "phpunit"
}
}