Pico/.travis.yml
Daniel Rudolf 58f615403e
Refactor Build system
- Separate Travis branch deployment and release deployment stages (also makes `deploy.sh` obsolete)
- Add `clean.sh` and `release.sh` scripts to allow users to create "release" packages locally
- Use `setup/*.sh` scripts to check and install build dependencies (like PHP_CodeSniffer, phpDocumentor and cloc)
- Use `create-release.sh` of `picocms/ci-tools` to create release archives
- Streamline script usage

Use the following to test Pico and to create a "release" package locally:

```sh
cd ~/My-Pico-Workspace/Components/pico

ln -rs ../ci-tools .build/ci-tools

. ./.build/ci-tools/init/local.sh.inc
. ./.build/init.sh.inc

phpcs --standard=.phpcs.xml "$PICO_PROJECT_DIR"

clean.sh
release.sh
```
2019-11-03 20:03:48 +01:00

75 lines
1.7 KiB
YAML

dist: trusty
sudo: false
language: php
cache:
directories:
- $HOME/.composer/cache/files
jobs:
include:
# Test stage
- php: 5.3
dist: precise
- php: 5.4
- php: 5.5
- php: 5.6
- php: 7.0
- php: 7.1
- php: 7.2
- php: 7.3
- php: nightly
- php: hhvm-3.27 # until Sep 2019
- php: hhvm-3.30 # until Nov 2019
# Branch deployment stage
- stage: deploy-branch
if: type == "push" && tag IS blank
php: 5.6
sudo: required
install:
- '[[ ",$DEPLOY_PHPDOC_BRANCHES," == *,"$TRAVIS_BRANCH",* ]] || travis_terminate 0'
- install.sh --deploy
script:
- deploy-branch.sh
# Release deployment stage
- stage: deploy-release
if: tag IS present
php: 5.3
dist: precise
install:
- install.sh --deploy
script:
- '[ "$PROJECT_REPO_TAG" == "v$(php -r "require_once(\"lib/Pico.php\"); echo Pico::VERSION;")" ]'
- deploy-release.sh
before_deploy:
- release.sh
deploy:
provider: releases
api_key: ${GITHUB_OAUTH_TOKEN}
file:
- pico-release-$PROJECT_REPO_TAG.tar.gz
- pico-release-$PROJECT_REPO_TAG.zip
skip_cleanup: true
name: Version ${PROJECT_REPO_TAG:1}
draft: true
# Ignore nightly build failures
allow_failures:
- php: nightly
fast_finish: true
before_install:
- export PICO_TOOLS_DIR="$HOME/__picocms_tools"
- git clone --branch="$TOOLS_REPO_BRANCH" "https://github.com/$TOOLS_REPO_SLUG.git" "$PICO_TOOLS_DIR"
- . "$PICO_TOOLS_DIR/init/travis.sh.inc"
- . "$PICO_PROJECT_DIR/.build/init.sh.inc"
install:
- install.sh
script:
- phpcs --standard=.phpcs.xml "$PICO_PROJECT_DIR"