forked from Jimdo/prometheus_client_php
-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce Continuous Integration (#20)
* WIP CI * Move few things around in CI pipeline * remove unneeded CI job
- Loading branch information
1 parent
5930a03
commit 63966cd
Showing
5 changed files
with
118 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
unit-config: &unit-config | ||
environment: | ||
COMPOSER_PREFER_LOWEST: 0 | ||
steps: | ||
- checkout | ||
|
||
- run: | ||
name: Install latest composer | ||
command: | | ||
php -r "copy('https://raw.githubusercontent.com/composer/getcomposer.org/master/web/installer', 'composer-setup.php');" | ||
php composer-setup.php | ||
php -r "unlink('composer-setup.php');" | ||
mv composer.phar /usr/local/bin/composer | ||
- run: | ||
name: Write COMPOSER_PREFER_LOWEST to file | ||
command: echo "$COMPOSER_PREFER_LOWEST" > ~/COMPOSER_PREFER_LOWEST.txt | ||
|
||
# Download and cache dependencies | ||
- restore_cache: | ||
keys: | ||
- v1-composer-cache-{{ checksum "~/COMPOSER_PREFER_LOWEST.txt" }}-{{ checksum "composer.json" }} | ||
# Fall back to using the latest cache if no exact match is found. | ||
- v1-composer-cache-{{ checksum "~/COMPOSER_PREFER_LOWEST.txt" }} | ||
|
||
- run: | ||
name: Validate composer files | ||
command: composer validate --strict | ||
|
||
- run: | ||
name: Install PHP extensions | ||
command: | | ||
printf '\n' | sudo pecl install redis | ||
sudo docker-php-ext-enable redis | ||
- run: | ||
name: Install composer packages | ||
command: | | ||
if [ $COMPOSER_PREFER_LOWEST -eq "1" ]; then | ||
composer update --no-ansi --no-progress --optimize-autoloader --no-interaction --no-plugins --no-scripts --prefer-dist --prefer-stable --prefer-lowest | ||
else | ||
composer update --no-ansi --no-progress --optimize-autoloader --no-interaction --no-plugins --no-scripts --prefer-dist --prefer-stable | ||
fi | ||
- save_cache: | ||
key: v1-composer-cache-{{ checksum "~/COMPOSER_PREFER_LOWEST.txt" }}-{{ checksum "composer.json" }} | ||
paths: | ||
- ./vendor | ||
|
||
- run: | ||
name: Wait for backing services to start | ||
command: dockerize -wait tcp://127.0.0.1:6379 -timeout 30s | ||
|
||
- run: | ||
name: Run tests | ||
command: ./vendor/bin/phpunit | ||
|
||
version: 2.1 | ||
jobs: | ||
php73: | ||
<<: *unit-config | ||
docker: | ||
- image: circleci/php:7.3-cli-node | ||
- image: circleci/redis:5-alpine | ||
environment: | ||
COMPOSER_PREFER_LOWEST: 0 | ||
|
||
php73-lowest: | ||
<<: *unit-config | ||
docker: | ||
- image: circleci/php:7.3-cli-node | ||
- image: circleci/redis:5-alpine | ||
environment: | ||
COMPOSER_PREFER_LOWEST: 1 | ||
|
||
workflows: | ||
version: 2 | ||
units: | ||
jobs: | ||
- php73 | ||
- php73-lowest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
* text=auto | ||
/.circleci/ export-ignore | ||
/.github/ export-ignore | ||
/examples/ export-ignore | ||
/nginx/ export-ignore | ||
/php-fpm/ export-ignore | ||
/tests/ export-ignore | ||
.gitattributes export-ignore | ||
.gitignore export-ignore | ||
docker-compose.yml export-ignore | ||
phpcs.xml.dist export-ignore | ||
phpunit.xml.dist export-ignore |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters