Skip to content

Commit b6c0d8a

Browse files
authored
Merge pull request #1 from pnlinh/circleci-project-setup
Add .circleci/config.yml
2 parents a81c4ee + d00dffb commit b6c0d8a

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.circleci/config.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
version: 2
2+
jobs:
3+
build:
4+
working_directory: /var/www/html
5+
docker:
6+
- image: php:8.0-apache
7+
environment:
8+
APP_ENV: test
9+
steps:
10+
- run:
11+
name: Install system packages
12+
command: apt-get update && apt-get -y install git zip unzip
13+
- run:
14+
name: Install PHP extensions
15+
command: docker-php-ext-install pdo
16+
- checkout
17+
- run:
18+
name: Install Composer
19+
command: |
20+
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
21+
php -r "if (hash_file('SHA384', 'composer-setup.php') === trim(file_get_contents('https://composer.github.io/installer.sig'))) { echo 'Installer verified'; } else { echo 'Installer invalid'; unlink('composer-setup.php'); } echo PHP_EOL;"
22+
php composer-setup.php
23+
php -r "unlink('composer-setup.php');"
24+
- run:
25+
name: Display PHP information
26+
command: |
27+
php -v
28+
php composer.phar --version
29+
- run:
30+
name: Install project dependencies
31+
command: php composer.phar install
32+
- run:
33+
name: Run CS Fixer
34+
command: vendor/bin/php-cs-fixer fix
35+
- run:
36+
name: Run Unit tests
37+
command: vendor/bin/phpunit tests/Feature

0 commit comments

Comments
 (0)