|
1 | 1 | name: Bundle CI
|
2 | 2 | on:
|
3 | 3 | push:
|
| 4 | + branches: ['main'] |
4 | 5 | pull_request:
|
5 | 6 | schedule:
|
6 | 7 | - cron: '0 */12 * * *'
|
7 | 8 |
|
8 | 9 | jobs:
|
9 |
| - composer-validate: |
10 |
| - name: Validate composer.json |
| 10 | + static-analysis: |
| 11 | + name: Static Analysis |
11 | 12 | runs-on: ubuntu-18.04
|
12 | 13 |
|
13 | 14 | steps:
|
14 |
| - - name: Checkout |
15 |
| - uses: actions/checkout@v2.0.0 |
| 15 | + - name: "Checkout code" |
| 16 | + uses: "actions/checkout@v2" |
16 | 17 |
|
17 |
| - - name: Validate |
18 |
| - run: composer validate --no-check-lock --strict |
| 18 | + - name: "Install PHP" |
| 19 | + uses: "shivammathur/setup-php@v2" |
| 20 | + with: |
| 21 | + coverage: "none" |
| 22 | + php-version: "8.0" |
19 | 23 |
|
20 |
| - php-cs-fixer: |
21 |
| - name: Lint Bundle Source |
22 |
| - runs-on: ubuntu-18.04 |
| 24 | + - name: "Validate composer.json" |
| 25 | + run: "composer validate --strict --no-check-lock" |
23 | 26 |
|
24 |
| - steps: |
25 |
| - - name: Set PHP Version |
26 |
| - run: sudo update-alternatives --set php /usr/bin/php7.4 |
27 |
| - - name: Checkout |
28 |
| - |
| 27 | + - name: "Composer install" |
| 28 | + uses: "ramsey/composer-install@v1" |
| 29 | + with: |
| 30 | + composer-options: "--prefer-stable" |
| 31 | + dependency-versions: 'highest' |
29 | 32 |
|
30 | 33 | - name: Install PHP-CS-Fixer
|
31 | 34 | run: composer global require friendsofphp/php-cs-fixer --prefer-dist --no-progress
|
32 | 35 |
|
33 |
| - - name: Enforce coding standards |
34 |
| - run: $HOME/.composer/vendor/bin/php-cs-fixer fix --config $GITHUB_WORKSPACE/.php-cs-fixer.dist.php --diff --dry-run |
35 |
| - |
36 |
| - psalm: |
37 |
| - name: Psalm Static Analysis |
38 |
| - runs-on: ubuntu-18.04 |
39 |
| - |
40 |
| - steps: |
41 |
| - - name: Set PHP Version |
42 |
| - run: sudo update-alternatives --set php /usr/bin/php7.4 |
43 |
| - |
44 |
| - - name: Checkout |
45 |
| - |
46 |
| - |
47 |
| - - name: Install dependencies |
48 |
| - run: composer install --prefer-dist --no-progress |
49 |
| - |
50 |
| - - name: Analyze Source |
| 36 | + - name: Running Pslam |
51 | 37 | run: vendor/bin/psalm -c $GITHUB_WORKSPACE/psalm.xml
|
52 | 38 |
|
53 |
| - stable-tests: |
54 |
| - name: Symfony Stable |
| 39 | + - name: Running php-cs-fixer |
| 40 | + run: $HOME/.composer/vendor/bin/php-cs-fixer fix --config $GITHUB_WORKSPACE/.php-cs-fixer.dist.php --diff --dry-run |
| 41 | + |
| 42 | + tests: |
| 43 | + name: "Tests ${{ matrix.php-version }} ${{ matrix.dependency-versions }} deps ${{ matrix.dependency-versions }}" |
55 | 44 | runs-on: ubuntu-18.04
|
56 | 45 |
|
57 | 46 | strategy:
|
58 | 47 | fail-fast: false
|
59 | 48 | matrix:
|
60 |
| - php-versions: ['7.2', '7.3', '7.4', '8.0'] |
61 |
| - symfony-version: ['4.4.*', '5.2.*'] |
| 49 | + # normal, highest, non-dev installs |
| 50 | + php-version: ['7.2', '7.3', '7.4', '8.0', '8.1'] |
| 51 | + composer-options: ['--prefer-stable'] |
| 52 | + dependency-versions: ['highest'] |
| 53 | + include: |
| 54 | + # testing lowest PHP version with lowest dependencies |
| 55 | + - php-version: '7.2.5' |
| 56 | + dependency-versions: 'lowest' |
| 57 | + composer-options: '--prefer-lowest' |
| 58 | + |
| 59 | + # testing dev versions with highest PHP |
| 60 | + - php-version: '8.0' |
| 61 | + dependency-versions: 'highest' |
| 62 | + composer-options: '' # allow dev deps |
62 | 63 |
|
63 | 64 | steps:
|
64 |
| - - name: Set PHP Version |
65 |
| - run: sudo update-alternatives --set php /usr/bin/php${{ matrix.php-versions }} |
66 |
| - |
67 |
| -# - name: Disable Xdebug |
68 |
| -# run: sudo rm /etc/php/${{ matrix.php-versions }}/cli/conf.d/20-xdebug.ini |
69 |
| - |
70 |
| - - name: Get PHP Version |
71 |
| - run: | |
72 |
| - ver=$(php -v | grep -oP '(?<=PHP )\d.\d') |
73 |
| - echo "::set-output name=version::$ver" |
74 |
| - id: php-ver |
75 |
| - |
76 |
| - - name: Using PHP Version from matrix |
77 |
| - run: | |
78 |
| - echo "Runner is not using PHP Version defined in the php-versions matrix." |
79 |
| - php -v |
80 |
| - exit 1 |
81 |
| - if: steps.php-ver.outputs.version != matrix.php-versions |
| 65 | + - name: "Checkout code" |
| 66 | + uses: "actions/checkout@v2" |
82 | 67 |
|
83 |
| - - name: Checkout |
84 |
| - |
| 68 | + - name: "Install PHP" |
| 69 | + uses: "shivammathur/setup-php@v2" |
| 70 | + with: |
| 71 | + coverage: "none" |
| 72 | + php-version: "${{ matrix.php-version }}" |
85 | 73 |
|
86 | 74 | - name: Install Global Dependencies
|
87 | 75 | run: |
|
88 | 76 | composer global require --no-progress --no-scripts --no-plugins symfony/flex dev-main
|
89 | 77 |
|
90 |
| - - name: Install dependencies |
91 |
| - run: | |
92 |
| - composer config minimum-stability stable |
93 |
| - composer update --prefer-dist --no-progress |
94 |
| - env: |
95 |
| - SYMFONY_REQUIRE: ${{ matrix.symfony-version }} |
96 |
| - |
97 |
| - - name: Unit Tests |
98 |
| - run: vendor/bin/simple-phpunit -c $GITHUB_WORKSPACE/phpunit.xml.dist --testsuite unit |
99 |
| - if: always() |
100 |
| - |
101 |
| - - name: Functional Tests |
102 |
| - run: vendor/bin/simple-phpunit -c $GITHUB_WORKSPACE/phpunit.xml.dist --testsuite functional |
103 |
| - if: always() |
104 |
| - |
105 |
| - - name: Integration Tests |
106 |
| - run: vendor/bin/simple-phpunit -c $GITHUB_WORKSPACE/phpunit.xml.dist --testsuite integration |
107 |
| - if: always() |
108 |
| - |
109 |
| - dev-main-tests: |
110 |
| - name: Symfony Main |
111 |
| - runs-on: ubuntu-18.04 |
112 |
| - |
113 |
| - strategy: |
114 |
| - fail-fast: false |
115 |
| - matrix: |
116 |
| - php-versions: ['7.2', '7.3', '7.4', '8.0'] |
117 |
| - |
118 |
| - steps: |
119 |
| - - name: Set PHP Version |
120 |
| - run: sudo update-alternatives --set php /usr/bin/php${{ matrix.php-versions }} |
121 |
| - |
122 |
| - - name: Get PHP Version |
123 |
| - run: | |
124 |
| - ver=$(php -v | grep -oP '(?<=PHP )\d.\d') |
125 |
| - echo "::set-output name=version::$ver" |
126 |
| - id: php-ver |
127 |
| - |
128 |
| - - name: Using PHP Version from matrix |
129 |
| - run: | |
130 |
| - echo "Runner is not using PHP Version defined in the php-versions matrix." |
131 |
| - php -v |
132 |
| - exit 1 |
133 |
| - if: steps.php-ver.outputs.version != matrix.php-versions |
134 |
| - |
135 |
| - - name: Checkout |
136 |
| - |
137 |
| - |
138 |
| - - name: Install dependencies |
139 |
| - run: composer update --prefer-dist --no-progress |
140 |
| - |
141 |
| - - name: Unit Tests |
142 |
| - run: vendor/bin/simple-phpunit -c $GITHUB_WORKSPACE/phpunit.xml.dist --testsuite unit |
143 |
| - if: always() |
144 |
| - |
145 |
| - - name: Functional Tests |
146 |
| - run: vendor/bin/simple-phpunit -c $GITHUB_WORKSPACE/phpunit.xml.dist --testsuite functional |
147 |
| - if: always() |
148 |
| - |
149 |
| - - name: Integration Tests |
150 |
| - run: vendor/bin/simple-phpunit -c $GITHUB_WORKSPACE/phpunit.xml.dist --testsuite integration |
151 |
| - if: always() |
152 |
| - |
153 |
| - lowest-version-tests: |
154 |
| - name: Lowest dependencies |
155 |
| - runs-on: ubuntu-18.04 |
156 |
| - |
157 |
| - strategy: |
158 |
| - fail-fast: false |
159 |
| - matrix: |
160 |
| - php-versions: ['7.2', '7.3', '7.4', '8.0'] |
161 |
| - |
162 |
| - steps: |
163 |
| - - name: Set PHP Version |
164 |
| - run: sudo update-alternatives --set php /usr/bin/php${{ matrix.php-versions }} |
165 |
| - |
166 |
| - - name: Get PHP Version |
167 |
| - run: | |
168 |
| - ver=$(php -v | grep -oP '(?<=PHP )\d.\d') |
169 |
| - echo "::set-output name=version::$ver" |
170 |
| - id: php-ver |
171 |
| - |
172 |
| - - name: Using PHP Version from matrix |
173 |
| - run: | |
174 |
| - echo "Runner is not using PHP Version defined in the php-versions matrix." |
175 |
| - php -v |
176 |
| - exit 1 |
177 |
| - if: steps.php-ver.outputs.version != matrix.php-versions |
178 |
| - |
179 |
| - - name: Checkout |
180 |
| - |
181 |
| - |
182 |
| - - name: Install dependencies |
183 |
| - run: composer update --prefer-lowest --prefer-dist --no-progress |
| 78 | + - name: "Composer install" |
| 79 | + uses: "ramsey/composer-install@v1" |
| 80 | + with: |
| 81 | + dependency-versions: "${{ matrix.dependency-versions }}" |
| 82 | + composer-options: "--prefer-dist --no-progress" |
184 | 83 |
|
185 | 84 | - name: Unit Tests
|
186 | 85 | run: vendor/bin/simple-phpunit -c $GITHUB_WORKSPACE/phpunit.xml.dist --testsuite unit
|
187 |
| - if: always() |
188 | 86 |
|
189 | 87 | - name: Functional Tests
|
190 | 88 | run: vendor/bin/simple-phpunit -c $GITHUB_WORKSPACE/phpunit.xml.dist --testsuite functional
|
191 |
| - if: always() |
192 | 89 |
|
193 | 90 | - name: Integration Tests
|
194 | 91 | run: vendor/bin/simple-phpunit -c $GITHUB_WORKSPACE/phpunit.xml.dist --testsuite integration
|
195 |
| - if: always() |
0 commit comments