Skip to content
This repository was archived by the owner on May 11, 2020. It is now read-only.

Commit 27b32db

Browse files
Merge pull request #88 from phpsw/feature/circle-ci-2
UPDATE to CircleCI V2
2 parents 0a3f295 + 9569b5a commit 27b32db

File tree

9 files changed

+198
-79
lines changed

9 files changed

+198
-79
lines changed

.circleci/config.yml

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
version: 2
2+
3+
php-image: &php-image
4+
docker:
5+
- image: circleci/php:7.1-cli-stretch
6+
7+
8+
restore-php-cache: &restore-php-cache
9+
restore_cache:
10+
keys:
11+
- php-vendors-v1-{{ checksum "yarn.lock"}}
12+
- php-vendors-v1
13+
14+
composer-install: &composer-install
15+
run:
16+
name: Composer install
17+
command: composer install --no-interaction --no-scripts --prefer-dist
18+
19+
save-php-cache: &save-php-cache
20+
save_cache:
21+
key: php-vendors-v1-{{ checksum "composer.lock" }}
22+
paths:
23+
- vendor
24+
25+
26+
jobs:
27+
node:
28+
docker:
29+
- image: circleci/node:8
30+
31+
steps:
32+
- checkout
33+
- restore_cache:
34+
keys:
35+
- npm-vendors-v1-{{ checksum "yarn.lock"}}
36+
- npm-vendors-v1
37+
38+
- run:
39+
name: Yarn install
40+
command: yarn install
41+
42+
- save_cache:
43+
key: npm-vendors-{{ checksum "yarn.lock"}}
44+
paths:
45+
- node_modules
46+
47+
- run:
48+
name: Run front end build
49+
command: yarn prod
50+
51+
52+
php:
53+
<<: *php-image
54+
55+
steps:
56+
- checkout
57+
- *restore-php-cache
58+
- *composer-install
59+
- *save-php-cache
60+
- run:
61+
name: Create test version of secrets.yml
62+
command: cp app/config/secrets_test.yml app/config/secrets.yml
63+
- run:
64+
name: Run CI
65+
command: composer ci
66+
67+
- store-test-results:
68+
path: reports
69+
70+
security:
71+
<<: *php-image
72+
73+
steps:
74+
- checkout
75+
- *restore-php-cache
76+
- *composer-install
77+
- *save-php-cache
78+
79+
- run:
80+
name: PHP security check
81+
command: composer security
82+
83+
84+
workflows:
85+
version: 2
86+
commit:
87+
jobs:
88+
- node
89+
- php
90+
- security
91+
92+
93+
security-check:
94+
triggers:
95+
- schedule:
96+
cron: "33 12 * * *"
97+
filters:
98+
branches:
99+
only: develop
100+
101+
jobs:
102+
- security

ci/run.sh

-42
This file was deleted.

circle.yml

-29
This file was deleted.

composer.json

+18
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,23 @@
3838
"psr-4" : {
3939
"Phpsw\\Website\\Tests\\" : "app/test/"
4040
}
41+
},
42+
"scripts": {
43+
"ci" : [
44+
"@composer-validate",
45+
"@lint",
46+
"@cs",
47+
"@test",
48+
"@validate-data",
49+
"@generate-website"
50+
],
51+
"composer-validate" : "@composer validate --no-check-all --strict",
52+
"lint" : "parallel-lint app runner.php",
53+
"cs" : "php-cs-fixer fix -v --dry-run --verbose --format=junit > reports/phpcs/junit.xml",
54+
"cs-fix" : "php-cs-fixer fix -v",
55+
"test" : "phpunit --log-junit reports/phpunit/junit.xml",
56+
"validate-data" : "php runner.php phpsw:validate-data",
57+
"generate-website" : "php runner.php phpsw:generate-website",
58+
"security" : "security-checker security:check"
4159
}
4260
}

composer.lock

+66-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

readme.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,11 @@ This assumes:
5353
- local hosts is setup (see getting started)
5454

5555

56+
## Auto fixing coding standards
57+
Prior to every commit execute ```composer cs-fix``` from within the VM. This will fix any code style issues.
58+
5659
## CI
57-
Execute ```ci/run.sh``` from within the VM to run the CI tests locally.
60+
Execute ```composer ci``` from within the VM to run the CI tests locally.
5861

5962

6063
## Architecture

reports/.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*
2+
!.gitignore
3+
!phpcs
4+
!phpunit

reports/phpcs/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

reports/phpunit/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

0 commit comments

Comments
 (0)