forked from deprecated-packages/pehapkari.cz-old
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
52 lines (44 loc) · 2.57 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
language: php
matrix:
include:
- php: 7.1
env: PHPUNIT_FLAGS="--coverage-clover coverage.xml" CHECK_CS=1 RUN_PHPSTAN=1
env:
global:
# Go to: Gitub User => Settings => Personal Access Token => Generate New Token
# Select "Repo" scope
# Download Travis CLI tool locally: https://github.com/travis-ci/travis.rb#installation
# Run in shell in repository root: travis encrypt GH_TOKEN=<code>
# If repo is not recognized by travis api, go to https://travis-ci.org/<repository-slug>, like githu.com/<repository-slug>
# And add it there; like you do when you want to run tests on some repository
- secure: rEiaq5+CAd1qtkY8k4sjk++XMJx+HawwyxN2QrF8yZHsUpqm8wws7goQ649kXVcHNVbe+FdWoinkWah6MjKejGnpgc7jwWhy7Q6JuUdPNmWkgWsjtXljwBg87f4RFtZ4n9uw8QYAw1azH3iUkHbTeSco8Za+5USgl9NM5S9hgDDStT3kD5BqDzPnaVe+UYwULqvBgAuwzdaUVFrNbHMZvfwPyDKnLdkt6XUmpkc1jriGuoz6i03WmK1JjoeW0JcGSThhv+QCN3nWb7BRk42ZLU40v/bjR4MXXLe0ys7drbPXDIF3MUXqq9KVsNsK7BctnmDc/pqXc517n91+41A+tTegdAOj0XCGIfCqMzZcapqY0Mi00zw2MmyjL9nUbHCkaLdL5bnJMSDj6ck2hsooZnpy5C+aiLFp0Hy/DyFIJsyKecoFZ89CEMcjzhrBPi9oSepcyCZ3Z6K/ataPfmvpaoGQw+X3/tdV33I73t4eydcxNMuPjLNYTsxrch8eyV80AbIalXikZypugdR8xfX4q2DWsmLgF+iuBD7aZPJEQAyoFd4fFtQO466NXS4M+YyNN4oHi77ztrkib9v3YuX7vUAJFfB34BN59TGBJJyK2AujDIkzLS1onSTgu0Od0Mkrsxgib8jlthBM3Hd7IwVQLEMSSkKDaVoYyBmtD406wSs=
before_script:
# to fasten up installation with parallel downloading
- composer global require hirak/prestissimo
# install composer dependencies
- composer install
script:
# run tests for tested posts (with "tested: true" in header configuration)
- vendor/bin/phpunit $PHPUNIT_FLAGS
# check coding standard (defined in composer.json "scripts" section)
- if [[ $CHECK_CS = 1 ]]; then composer check-cs; fi
# check with phpstan (defined in composer.json "scripts" section)
- if [[ $RUN_PHPSTAN = 1 ]]; then composer phpstan; fi
# test that website is generated
- vendor/bin/statie generate
# re-build website when on master only
- |
if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then
vendor/bin/statie push-to-github pehapkari/pehapkari.cz --token=${GH_TOKEN}
fi
after_script:
# upload coverage.xml file to Scrutinizer to analyze it
- |
if [ "$PHPUNIT_FLAGS" != "" ]; then
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover coverage.xml
fi
# do not send success notifications, they have no value
notifications:
email:
on_success: never