This repository has been archived by the owner on Aug 16, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.travis.yml
116 lines (98 loc) · 2.76 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
language: php
dist: trusty
# Wait until travis bug fixes
sudo: require
branches:
only:
- master
- /^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/
services:
- mysql
cache:
apt: true
yarn: true
directories:
- $HOME/.composer/cache/files
addons:
apt:
packages:
- nginx
notifications:
email:
on_success: never
on_failure: change
php:
- 7.0
- 7.1
env:
global:
- COMPOSER_NO_INTERACTION=1
matrix:
- WP_VERSION=nightly
- WP_VERSION=latest WITH_COVERAGE=true
- WP_VERSION=4.8
- WP_VERSION=4.7.5
matrix:
allow_failures:
- env: WP_VERSION=nightly
fast_finish: true
before_install:
# Disable xDebug to speed up the build unless test coverage is needed
- if [[ "$WITH_COVERAGE" != "true" ]]; then phpenv config-rm xdebug.ini; fi
# Install helper scripts
- travis_retry composer global require --prefer-dist --no-suggest typisttech/travis-nginx-wordpress
- export PATH=$HOME/.composer/vendor/bin:$PATH
- tnw-install-nginx
- tnw-install-wordpress
- tnw-prepare-codeception
# Build the production plugin
- travis_retry composer build
# Activate the plugin
- wp plugin install ./release/wp-cloudflare-guard.zip --force --activate --path=/tmp/wordpress
# Export a dump of plugin-activated database to the _data folder
- wp db export $TRAVIS_BUILD_DIR/tests/_data/dump.sql --path=/tmp/wordpress
install:
- travis_retry composer install --prefer-dist --no-suggest
script:
- if [[ "$WITH_COVERAGE" == "true" ]]; then vendor/bin/codecept run --coverage --coverage-xml; fi
- if [[ "$WITH_COVERAGE" != "true" ]]; then vendor/bin/codecept run; fi
after_script:
- if [[ "$WITH_COVERAGE" == "true" ]]; then travis_retry tnw-upload-coverage-to-scrutinizer; fi
- if [[ "$WITH_COVERAGE" == "true" ]]; then travis_retry tnw-upload-coverage-to-codecov; fi
before_deploy:
- unzip -qo release/wp-cloudflare-guard.zip -d build
deploy:
- provider: releases
api_key: $GITHUB_ACCESS_TOKEN
file: release/wp-cloudflare-guard.zip
skip_cleanup: true
on:
condition: "$WP_VERSION = latest"
php: 7.0
tags: true
repo: TypistTech/wp-cloudflare-guard
- provider: wordpress-plugin
edge:
source: TypistTech/dpl
branch: add-wordpress-plugin-deployment
slug: wp-cloudflare-guard
username: tangrufus
build_dir: build
assets_dir: assets
skip_cleanup: true
on:
condition: "$WP_VERSION = latest"
php: 7.1
tags: true
repo: TypistTech/wp-cloudflare-guard
- provider: pages
skip_cleanup: true
github_token: $GITHUB_ACCESS_TOKEN
local_dir: build
target_branch: nightly
project_name: "WP Cloudflare Guard"
on:
branch: master
condition: "$WP_VERSION = latest"
php: 7.0
repo: TypistTech/wp-cloudflare-guard