|
1 | | -# https://help.github.com/en/categories/automating-your-workflow-with-github-actions |
2 | | - |
3 | | -name: "Continuous Integration" |
4 | | - |
5 | | -on: |
6 | | - pull_request: |
7 | | - push: |
8 | | - |
| 1 | +name: CI |
| 2 | +on: [ push, pull_request ] |
9 | 3 | jobs: |
10 | | - phpunit: |
11 | | - name: "PHPUnit tests" |
12 | | - |
| 4 | + ci: |
| 5 | + name: "CI" |
13 | 6 | runs-on: ${{ matrix.operating-system }} |
14 | | - |
15 | 7 | strategy: |
16 | 8 | matrix: |
17 | | - dependencies: |
18 | | - - "locked" |
19 | | - php-version: |
20 | | - - "8.0" |
21 | | - - "8.1" |
22 | | - - "8.2" |
23 | | - operating-system: |
24 | | - - "ubuntu-latest" |
25 | | - - "windows-latest" |
26 | | - - "macos-latest" |
27 | | - |
| 9 | + operating-system: [ ubuntu-latest, windows-latest, macos-latest ] |
| 10 | + php-version: [ 8.0, 8.3 ] |
28 | 11 | steps: |
| 12 | + |
| 13 | + # --------- Setup steps --------- |
29 | 14 | - name: "Checkout" |
30 | | - uses: "actions/checkout@v3" |
| 15 | + uses: actions/checkout@v3 |
31 | 16 |
|
32 | | - - name: "Install PHP" |
33 | | - uses: "shivammathur/setup-php@v2" |
| 17 | + - name: "Setup PHP" |
| 18 | + uses: shivammathur/setup-php@v2 |
34 | 19 | with: |
35 | 20 | coverage: "pcov" |
36 | 21 | php-version: "${{ matrix.php-version }}" |
37 | 22 | ini-values: memory_limit=-1 |
38 | | - extensions: sodium, fileinfo |
| 23 | + extensions: pcov, xdebug, sodium, fileinfo |
39 | 24 |
|
40 | 25 | - name: "Install dependencies" |
41 | | - uses: "ramsey/composer-install@v2" |
42 | | - with: |
43 | | - dependency-versions: "${{ matrix.dependencies }}" |
| 26 | + uses: ramsey/composer-install@v2 |
44 | 27 |
|
45 | | - - name: "Tests" |
| 28 | + # --------- Run steps --------- |
| 29 | + - name: "Unit Tests" |
46 | 30 | run: "composer test" |
47 | 31 |
|
48 | | - static-analysis-psalm: |
49 | | - name: "Static Analysis by Psalm" |
50 | | - |
51 | | - runs-on: ${{ matrix.operating-system }} |
52 | | - |
53 | | - strategy: |
54 | | - matrix: |
55 | | - dependencies: |
56 | | - - "locked" |
57 | | - php-version: |
58 | | - - "8.0" |
59 | | - operating-system: |
60 | | - - "ubuntu-latest" |
61 | | - |
62 | | - steps: |
63 | | - - name: "Checkout" |
64 | | - uses: "actions/checkout@v3" |
65 | | - |
66 | | - - name: "Install PHP" |
67 | | - uses: "shivammathur/setup-php@v2" |
68 | | - with: |
69 | | - coverage: "none" |
70 | | - php-version: "${{ matrix.php-version }}" |
71 | | - ini-values: memory_limit=-1 |
72 | | - extensions: sodium, fileinfo |
73 | | - |
74 | | - - name: "Install dependencies" |
75 | | - uses: "ramsey/composer-install@v2" |
76 | | - with: |
77 | | - dependency-versions: "${{ matrix.dependencies }}" |
| 32 | + - name: "Coding Style" |
| 33 | + run: "composer cs-fix" |
78 | 34 |
|
79 | | - - name: "psalm" |
| 35 | + - name: "Static code analysis" |
80 | 36 | run: "composer psalm" |
81 | | - |
82 | | - coding-standards: |
83 | | - name: "Check Coding Standards" |
84 | | - |
85 | | - runs-on: ${{ matrix.operating-system }} |
86 | | - |
87 | | - strategy: |
88 | | - matrix: |
89 | | - dependencies: |
90 | | - - "locked" |
91 | | - php-version: |
92 | | - - "8.0" |
93 | | - operating-system: |
94 | | - - "ubuntu-latest" |
95 | | - |
96 | | - steps: |
97 | | - - name: "Checkout" |
98 | | - uses: "actions/checkout@v3" |
99 | | - |
100 | | - - name: "Install PHP" |
101 | | - uses: "shivammathur/setup-php@v2" |
102 | | - with: |
103 | | - coverage: "none" |
104 | | - php-version: "${{ matrix.php-version }}" |
105 | | - ini-values: memory_limit=-1 |
106 | | - extensions: sodium, fileinfo |
107 | | - |
108 | | - - name: "Install dependencies" |
109 | | - uses: "ramsey/composer-install@v2" |
110 | | - with: |
111 | | - dependency-versions: "${{ matrix.dependencies }}" |
112 | | - |
113 | | - - name: "Coding Standard" |
114 | | - run: "composer check-style" |
0 commit comments