@@ -0,0 +1,90 @@ |
|
|
|
1 |
+# https://help.github.com/en/categories/automating-your-workflow-with-github-actions |
|
2 |
+ |
|
3 |
+on: |
|
4 |
+ - "pull_request" |
|
5 |
+ - "push" |
|
6 |
+ |
|
7 |
+name: "CI" |
|
8 |
+ |
|
9 |
+jobs: |
|
10 |
+coding-guidelines: |
|
11 |
+name: Coding Guidelines |
|
12 |
+ |
|
13 |
+runs-on: ubuntu-latest |
|
14 |
+ |
|
15 |
+steps: |
|
16 |
+ - name: Checkout |
|
17 |
+uses: actions/checkout@v2 |
|
18 |
+ |
|
19 |
+ - name: Install PHP |
|
20 |
+uses: shivammathur/setup-php@v2 |
|
21 |
+with: |
|
22 |
+php-version: 7.4 |
|
23 |
+coverage: none |
|
24 |
+ |
|
25 |
+ - name: Run friendsofphp/php-cs-fixer |
|
26 |
+run: ./tools/php-cs-fixer fix --diff-format=udiff --dry-run --show-progress=dots --using-cache=no --verbose |
|
27 |
+ |
|
28 |
+type-checker: |
|
29 |
+name: Type Checker |
|
30 |
+ |
|
31 |
+runs-on: ubuntu-latest |
|
32 |
+ |
|
33 |
+steps: |
|
34 |
+ - name: Checkout |
|
35 |
+uses: actions/checkout@v2 |
|
36 |
+ |
|
37 |
+ - name: Install PHP |
|
38 |
+uses: shivammathur/setup-php@v2 |
|
39 |
+with: |
|
40 |
+php-version: 7.4 |
|
41 |
+coverage: none |
|
42 |
+ |
|
43 |
+ - name: Update dependencies with composer |
|
44 |
+run: ./tools/composer update --no-interaction --no-ansi --no-progress |
|
45 |
+ |
|
46 |
+ - name: Run vimeo/psalm |
|
47 |
+run: ./tools/psalm --no-progress --shepherd --show-info=false --stats |
|
48 |
+ |
|
49 |
+tests: |
|
50 |
+name: Tests |
|
51 |
+ |
|
52 |
+runs-on: ubuntu-latest |
|
53 |
+ |
|
54 |
+strategy: |
|
55 |
+matrix: |
|
56 |
+php-version: |
|
57 |
+ - "7.3" |
|
58 |
+ - "7.4" |
|
59 |
+ - "8.0" |
|
60 |
+ |
|
61 |
+steps: |
|
62 |
+ - name: "Checkout" |
|
63 |
+uses: "actions/checkout@v2" |
|
64 |
+ |
|
65 |
+ - name: "Install PHP with extensions" |
|
66 |
+uses: "shivammathur/setup-php@v1" |
|
67 |
+with: |
|
68 |
+php-version: "${{ matrix.php-version }}" |
|
69 |
+coverage: "pcov" |
|
70 |
+ |
|
71 |
+ - name: "Cache dependencies installed with composer" |
|
72 |
+uses: "actions/cache@v1" |
|
73 |
+with: |
|
74 |
+path: "~/.composer/cache" |
|
75 |
+key: "php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }}" |
|
76 |
+restore-keys: "php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" |
|
77 |
+ |
|
78 |
+ - name: "Set COMPOSER_ROOT_VERSION environment variable" |
|
79 |
+uses: "docker://ergebnis/composer-root-version-action:0.1.3" |
|
80 |
+ |
|
81 |
+ - name: "Install dependencies with composer" |
|
82 |
+run: "./tools/composer update --no-ansi --no-interaction --no-progress" |
|
83 |
+ |
|
84 |
+ - name: "Run tests with phpunit/phpunit" |
|
85 |
+run: "vendor/bin/phpunit --coverage-clover=coverage.xml" |
|
86 |
+ |
|
87 |
+ - name: "Send code coverage report to Codecov.io" |
|
88 |
+env: |
|
89 |
+CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}" |
|
90 |
+run: "bash <(curl -s https://codecov.io/bash) | |