forked from xwp/stream
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
95 lines (79 loc) · 2.46 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
dist: xenial
language: php
php: "7.4"
jobs:
include:
- stage: test
name: Default Test
before_script:
- 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
after_script:
- test -f ./tests/reports/clover.xml && composer test-report || true
- ./cc-test-reporter format-coverage --input-type clover tests/reports/clover.xml --output tests/reports/codeclimate.json
- ./cc-test-reporter upload-coverage --input tests/reports/codeclimate.json
- name: Test with PHP 5.6
env:
WORDPRESS_IMAGE_VERSION: php5.6
- name: Test with PHP 7.4
env:
WORDPRESS_IMAGE_VERSION: php7.4
- name: Test with PHP 8.0
env:
WORDPRESS_IMAGE_VERSION: php8.0
# PHP unit tests are broken so we limit to linting for now.
script: npm run lint
- name: Test Release Bundle
script: npm run release
- stage: deploy
name: Tag Release
if: tag IS present
script: npm run release
deploy:
provider: releases
api_key:
secure: HheYiv6c8ipHzMZBTH7xcKrOwCllvJTtfiTffAPK6XubWe3Kudn6IJUv0p1gmRhWXxZ5ciJQ/sgiCRGTRm/bubHs4tS7JOmpmoTdkrXajTxyyDCKpxhtT43nie0vNF+pWqVu2yOjhDR4pwtWjpQdzEKOz0kn0XSMT+vGsKQD50w=
overwrite: true
skip_cleanup: true
file:
- stream.zip
- stream-$TRAVIS_TAG.zip
on:
all_branches: true
repo: xwp/stream
- name: Tag Package
if: branch IS present AND type = push
script: npm run release
before_deploy:
- openssl aes-256-cbc -K $encrypted_49634e5b1863_key -iv $encrypted_49634e5b1863_iv -in ./local/travis/travis_deploy_key.enc -out ~/.ssh/id_rsa -d
- chmod 600 ~/.ssh/id_rsa
deploy:
provider: script
script: ./local/scripts/dist.sh
skip_cleanup: true
on:
all_branches: true
repo: xwp/stream
services:
- docker
before_install:
- echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker-compose pull
- nvm install
- nvm use
# Lock to Composer version 1 for now.
- composer self-update --1
install:
- npm install
- composer install
script:
- npm run lint
- npm run phpunit
- npm run phpunit-multisite
notifications:
email: false
cache:
npm: true
directories:
- $HOME/.composer/cache