|
| 1 | +name: "build" |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - "master" |
| 6 | + pull_request: ~ |
| 7 | + schedule: |
| 8 | + - cron: "5 8 * * 1" |
| 9 | + |
| 10 | +env: |
| 11 | + APP_ENV: "test" |
| 12 | + DATABASE_URL: "mysql://root:root@127.0.0.1/sylius?serverVersion=5.7" |
| 13 | + PHP_EXTENSIONS: "intl, mbstring" |
| 14 | + |
| 15 | +jobs: |
| 16 | + coding-standards: |
| 17 | + name: "Coding Standards" |
| 18 | + |
| 19 | + runs-on: "ubuntu-latest" |
| 20 | + |
| 21 | + strategy: |
| 22 | + matrix: |
| 23 | + php-version: |
| 24 | + - "7.4" |
| 25 | + |
| 26 | + dependencies: |
| 27 | + - "highest" |
| 28 | + |
| 29 | + steps: |
| 30 | + - name: "Checkout" |
| 31 | + uses: "actions/checkout@v2" |
| 32 | + |
| 33 | + - name: "Setup PHP, with composer and extensions" |
| 34 | + uses: "shivammathur/setup-php@v2" |
| 35 | + with: |
| 36 | + php-version: "${{ matrix.php-version }}" |
| 37 | + extensions: "${{ env.PHP_EXTENSIONS }}" |
| 38 | + coverage: "none" |
| 39 | + tools: "composer:v1" |
| 40 | + |
| 41 | + - name: "Install composer dependencies" |
| 42 | + uses: "ramsey/composer-install@v1" |
| 43 | + with: |
| 44 | + dependency-versions: "${{ matrix.dependencies }}" |
| 45 | + |
| 46 | + - name: "Validate composer" |
| 47 | + run: "composer validate --strict" |
| 48 | + |
| 49 | + - name: "Check composer normalized" |
| 50 | + run: "composer normalize --dry-run" |
| 51 | + |
| 52 | + - name: "Check style" |
| 53 | + run: "composer check-style" |
| 54 | + |
| 55 | + - name: "Lint yaml files" |
| 56 | + run: "(cd tests/Application && bin/console lint:yaml ../../src/Resources)" |
| 57 | + |
| 58 | + - name: "Lint twig files" |
| 59 | + run: "(cd tests/Application && bin/console lint:twig ../../src/Resources)" |
| 60 | + |
| 61 | + dependency-analysis: |
| 62 | + name: "Dependency Analysis" |
| 63 | + |
| 64 | + runs-on: "ubuntu-latest" |
| 65 | + |
| 66 | + strategy: |
| 67 | + matrix: |
| 68 | + php-version: |
| 69 | + - "7.4" |
| 70 | + |
| 71 | + dependencies: |
| 72 | + - "highest" |
| 73 | + |
| 74 | + steps: |
| 75 | + - name: "Checkout" |
| 76 | + uses: "actions/checkout@v2.3.2" |
| 77 | + |
| 78 | + - name: "Setup PHP, with composer and extensions" |
| 79 | + uses: "shivammathur/setup-php@2.5.0" |
| 80 | + with: |
| 81 | + coverage: "none" |
| 82 | + extensions: "${{ env.PHP_EXTENSIONS }}" |
| 83 | + php-version: "${{ matrix.php-version }}" |
| 84 | + tools: "composer:v1, composer-require-checker, composer-unused" |
| 85 | + |
| 86 | + - name: "Install composer dependencies" |
| 87 | + uses: "ramsey/composer-install@v1" |
| 88 | + with: |
| 89 | + dependency-versions: "${{ matrix.dependencies }}" |
| 90 | + |
| 91 | + - name: "Run maglnet/composer-require-checker" |
| 92 | + run: "composer-require-checker check --config-file=$(pwd)/composer-require-checker.json" |
| 93 | + |
| 94 | + - name: "Run composer-unused/composer-unused" |
| 95 | + run: "composer-unused" |
| 96 | + |
| 97 | + static-code-analysis: |
| 98 | + name: "Static Code Analysis" |
| 99 | + |
| 100 | + runs-on: "ubuntu-latest" |
| 101 | + |
| 102 | + strategy: |
| 103 | + matrix: |
| 104 | + php-version: |
| 105 | + - "7.4" |
| 106 | + |
| 107 | + dependencies: |
| 108 | + - "highest" |
| 109 | + |
| 110 | + steps: |
| 111 | + - name: "Checkout" |
| 112 | + uses: "actions/checkout@v2" |
| 113 | + |
| 114 | + - name: "Setup PHP, with composer and extensions" |
| 115 | + uses: "shivammathur/setup-php@v2" |
| 116 | + with: |
| 117 | + php-version: "${{ matrix.php-version }}" |
| 118 | + extensions: "${{ env.PHP_EXTENSIONS }}" |
| 119 | + coverage: "none" |
| 120 | + tools: "composer:v1" |
| 121 | + |
| 122 | + - name: "Install composer dependencies" |
| 123 | + uses: "ramsey/composer-install@v1" |
| 124 | + with: |
| 125 | + dependency-versions: "${{ matrix.dependencies }}" |
| 126 | + |
| 127 | + - name: "Static analysis" |
| 128 | + run: "composer analyse" |
| 129 | + |
| 130 | + unit-tests: |
| 131 | + name: "Unit tests" |
| 132 | + |
| 133 | + runs-on: "ubuntu-latest" |
| 134 | + |
| 135 | + strategy: |
| 136 | + matrix: |
| 137 | + php-version: |
| 138 | + - "7.4" |
| 139 | + |
| 140 | + dependencies: |
| 141 | + - "lowest" |
| 142 | + - "highest" |
| 143 | + |
| 144 | + steps: |
| 145 | + - name: "Checkout" |
| 146 | + uses: "actions/checkout@v2" |
| 147 | + |
| 148 | + - name: "Setup PHP, with composer and extensions" |
| 149 | + uses: "shivammathur/setup-php@v2" |
| 150 | + with: |
| 151 | + php-version: "${{ matrix.php-version }}" |
| 152 | + extensions: "${{ env.PHP_EXTENSIONS }}" |
| 153 | + coverage: "none" |
| 154 | + tools: "composer:v1" |
| 155 | + |
| 156 | + - name: "Install composer dependencies" |
| 157 | + uses: "ramsey/composer-install@v1" |
| 158 | + with: |
| 159 | + dependency-versions: "${{ matrix.dependencies }}" |
| 160 | + |
| 161 | + - name: "Run phpspec" |
| 162 | + run: "composer phpspec" |
| 163 | + |
| 164 | + - name: "Run phpunit" |
| 165 | + run: "composer phpunit" |
| 166 | + |
| 167 | + integration-tests: |
| 168 | + name: "Integration tests" |
| 169 | + |
| 170 | + runs-on: "ubuntu-latest" |
| 171 | + |
| 172 | + strategy: |
| 173 | + matrix: |
| 174 | + php-version: |
| 175 | + - "7.4" |
| 176 | + |
| 177 | + dependencies: |
| 178 | + - "highest" |
| 179 | + |
| 180 | + steps: |
| 181 | + - name: "Start MySQL" |
| 182 | + run: "sudo /etc/init.d/mysql start" |
| 183 | + |
| 184 | + - name: "Checkout" |
| 185 | + uses: "actions/checkout@v2" |
| 186 | + |
| 187 | + - name: "Setup PHP, with composer and extensions" |
| 188 | + uses: "shivammathur/setup-php@v2" |
| 189 | + with: |
| 190 | + php-version: "${{ matrix.php-version }}" |
| 191 | + extensions: "${{ env.PHP_EXTENSIONS }}" |
| 192 | + coverage: "none" |
| 193 | + tools: "composer:v1" |
| 194 | + |
| 195 | + - name: "Install composer dependencies" |
| 196 | + uses: "ramsey/composer-install@v1" |
| 197 | + with: |
| 198 | + dependency-versions: "${{ matrix.dependencies }}" |
| 199 | + |
| 200 | + - name: "Lint container" |
| 201 | + run: "(cd tests/Application && bin/console lint:container)" |
| 202 | + |
| 203 | + - name: "Create database" |
| 204 | + run: "(cd tests/Application && bin/console doctrine:database:create -vvv)" |
| 205 | + |
| 206 | + - name: "Create database schema" |
| 207 | + run: "(cd tests/Application && bin/console doctrine:schema:create -vvv)" |
| 208 | + |
| 209 | + - name: "Validate Doctrine mapping" |
| 210 | + run: "(cd tests/Application && bin/console doctrine:schema:validate -vvv)" |
| 211 | + |
| 212 | + code-coverage: |
| 213 | + name: "Code Coverage" |
| 214 | + |
| 215 | + runs-on: "ubuntu-latest" |
| 216 | + |
| 217 | + strategy: |
| 218 | + matrix: |
| 219 | + php-version: |
| 220 | + - "7.4" |
| 221 | + |
| 222 | + dependencies: |
| 223 | + - "highest" |
| 224 | + |
| 225 | + steps: |
| 226 | + - name: "Checkout" |
| 227 | + uses: "actions/checkout@v2.3.2" |
| 228 | + |
| 229 | + - name: "Setup PHP, with composer and extensions" |
| 230 | + uses: "shivammathur/setup-php@2.5.0" |
| 231 | + with: |
| 232 | + coverage: "pcov" |
| 233 | + extensions: "${{ env.PHP_EXTENSIONS }}" |
| 234 | + php-version: "${{ matrix.php-version }}" |
| 235 | + tools: "composer:v1" |
| 236 | + |
| 237 | + - name: "Set up problem matchers for phpunit/phpunit" |
| 238 | + run: "echo \"::add-matcher::${{ runner.tool_cache }}/phpunit.json\"" |
| 239 | + |
| 240 | + - name: "Install composer dependencies" |
| 241 | + uses: "ramsey/composer-install@v1" |
| 242 | + with: |
| 243 | + dependency-versions: "${{ matrix.dependencies }}" |
| 244 | + |
| 245 | + - name: "Collect code coverage with pcov and phpunit/phpunit" |
| 246 | + run: "vendor/bin/phpunit --coverage-clover=.build/logs/clover.xml" |
| 247 | + |
| 248 | + - name: "Send code coverage report to Codecov.io" |
| 249 | + env: |
| 250 | + CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}" |
| 251 | + run: "bash <(curl -s https://codecov.io/bash)" |
0 commit comments