7
7
- " push"
8
8
9
9
jobs :
10
- continuous-integratio :
10
+
11
+ init-php-doc :
12
+ name : " Init the php documentation cache"
13
+ runs-on : " ubuntu-latest"
14
+ steps :
15
+ - name : " Checkout"
16
+
17
+
18
+ - name : " Cache PHP documentation checked out with svn"
19
+ id : cache-svn
20
+
21
+ with :
22
+ path : " generator/doc/doc-en"
23
+ key : " php-documentation"
24
+
25
+ - name : " Check out PHP documentation with svn"
26
+ if : steps.cache-svn.outputs.cache-hit != 'true'
27
+ run : svn co https://svn.php.net/repository/phpdoc/modules/doc-en doc-en
28
+ working-directory : " generator/doc"
29
+
30
+ continuous-integration :
11
31
name : " Continuous Integration"
12
32
33
+ needs : init-php-doc
13
34
runs-on : " ubuntu-latest"
14
35
15
36
strategy :
@@ -31,12 +52,80 @@ jobs:
31
52
coverage : " none"
32
53
php-version : " ${{ matrix.php-version }}"
33
54
55
+ - name : " Cache PHP documentation checked out with svn"
56
+ id : cache-svn
57
+
58
+ with :
59
+ path : " generator/doc/doc-en"
60
+ key : " php-documentation"
61
+
34
62
- name : " Cache dependencies installed with composer"
35
63
36
64
with :
37
65
path : " ~/.composer/cache"
38
66
key : " php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}"
39
67
restore-keys : " php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"
40
68
69
+ - name : " Install dependencies with composer in generator/ directory"
70
+ run : " composer install --no-interaction"
71
+ working-directory : " generator"
72
+
41
73
- name : " Install dependencies with composer in root directory"
42
- run : " composer install --no-interaction --no-progress --no-suggest"
74
+ run : " composer install --no-interaction"
75
+
76
+ - name : " Run tests with phpunit/phpunit in generator/ directory"
77
+ run : " vendor/bin/phpunit"
78
+ working-directory : " generator"
79
+
80
+ - name : " Run coding standard checks with squizlabs/php_codesniffer in generator/ directory"
81
+ run : " composer cs-check"
82
+ working-directory : " generator"
83
+
84
+ - name : " Run static code analysis with phpstan/phpstan in generator/ directory"
85
+ run : " composer phpstan"
86
+ working-directory : " generator"
87
+
88
+ - name : " Dump autoloader with composer in root directory"
89
+ run : " composer dump-autoload"
90
+
91
+ - name : " Run coding standard checks with squizlabs/php_codesniffer in root directory"
92
+ run : " composer cs-check"
93
+
94
+ - name : " Run static code analysis with phpstan/phpstan in root directory"
95
+ run : " composer phpstan"
96
+
97
+ - name : " Regenerate files"
98
+ run : " ./safe.php generate"
99
+ working-directory : " generator"
100
+
101
+ - name : " Check if regenerated files are different"
102
+ run : |
103
+ if output=$(git status --porcelain) && [ -z "$output" ]; then
104
+ # all is good
105
+ echo "Generated files are the same as committed file: OK"
106
+ else
107
+ # Uncommitted changes
108
+ echo "Generated files are different from commited files. Please run './safe.php generate' command and commit the results."
109
+ echo "Detected changes:"
110
+ git status
111
+ git diff
112
+ echo "Generated files are different from commited files. Please run './safe.php generate' command and commit the results."
113
+ exit 1;
114
+ fi
115
+ - name : " Check if refactoring can be done with rector/rector:~0.5.0"
116
+ run : " composer install && composer rector && composer test"
117
+ working-directory : " generator/tests/rector/0.5"
118
+
119
+ - name : " Check if refactoring can be done with rector/rector:~0.6.0"
120
+ run : " composer install && composer rector && composer test"
121
+ working-directory : " generator/tests/rector/0.6"
122
+
123
+ # - name: "Archive code coverage results"
124
+ # uses: "actions/upload-artifact@v1"
125
+ # with:
126
+ # name: "build"
127
+ # path: "generator/build"
128
+ #
129
+ # - name: "Upload test coverage to coveralls"
130
+ # run: "php vendor/bin/php-coveralls -v"
131
+ # working-directory: "generator"
0 commit comments