|
8 | 8 |
|
9 | 9 | env:
|
10 | 10 | fail-fast: true
|
| 11 | + PHPUNIT_FLAGS: "-v" |
| 12 | + SYMFONY_PHPUNIT_DIR: "$HOME/symfony-bridge/.phpunit" |
| 13 | + SYMFONY_REQUIRE: ">=3.4" |
11 | 14 |
|
12 | 15 | jobs:
|
13 | 16 | coding-standards:
|
|
56 | 59 | -
|
57 | 60 | name: "Run friendsofphp/php-cs-fixer"
|
58 | 61 | run: "vendor/bin/php-cs-fixer fix --dry-run --diff"
|
| 62 | + |
| 63 | + test: |
| 64 | + name: "PHP ${{ matrix.php-version }} + symfony/skeleton@${{ matrix.symfony-skeleton-stability }}" |
| 65 | + |
| 66 | + runs-on: ubuntu-latest |
| 67 | + |
| 68 | + services: |
| 69 | + mysql: |
| 70 | + image: mysql:5.7 |
| 71 | + env: |
| 72 | + MYSQL_ROOT_PASSWORD: root |
| 73 | + MYSQL_DATABASE: test_maker |
| 74 | + ports: |
| 75 | + - 3306 |
| 76 | + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 |
| 77 | + |
| 78 | + continue-on-error: ${{ matrix.allow-failures }} |
| 79 | + |
| 80 | + env: |
| 81 | + SYMFONY_SKELETON_STABILITY: ${{ matrix.symfony-skeleton-stability }} |
| 82 | + |
| 83 | + strategy: |
| 84 | + matrix: |
| 85 | + php-version: |
| 86 | + - '7.1.33' |
| 87 | + - '7.2.5' |
| 88 | + - '7.3' |
| 89 | + - '7.4' |
| 90 | + symfony-skeleton-stability: |
| 91 | + - 'stable' |
| 92 | + allow-failures: [false] |
| 93 | + include: |
| 94 | + - php-version: '7.4' |
| 95 | + symfony-skeleton-stability: 'dev' |
| 96 | + allow-failures: true |
| 97 | + - php-version: '8.0' |
| 98 | + symfony-skeleton-stability: 'dev' |
| 99 | + allow-failures: true |
| 100 | + |
| 101 | + steps: |
| 102 | + - name: "Checkout code" |
| 103 | + |
| 104 | + |
| 105 | + - name: "Start MySQL" |
| 106 | + run: | |
| 107 | + sudo /etc/init.d/mysql start |
| 108 | +
|
| 109 | + - name: "Verify MySQL connection from host" |
| 110 | + run: | |
| 111 | + sudo apt-get install -y mysql-client |
| 112 | + mysql --host 127.0.0.1 --port 3306 -uroot -proot -e "SHOW DATABASES;" |
| 113 | +
|
| 114 | + - name: "Setup Database" |
| 115 | + run: | |
| 116 | + mysql --host 127.0.0.1 --port 3306 -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test_maker;" |
| 117 | +
|
| 118 | + - name: "Install PHP with extensions" |
| 119 | + uses: shivammathur/[email protected] |
| 120 | + with: |
| 121 | + coverage: "none" |
| 122 | + php-version: ${{ matrix.php-version }} |
| 123 | + tools: composer:v2 |
| 124 | + |
| 125 | + - name: "Add PHPUnit matcher" |
| 126 | + run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" |
| 127 | + |
| 128 | + - name: "Set composer cache directory" |
| 129 | + id: composer-cache |
| 130 | + run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 131 | + |
| 132 | + - name: "Cache composer" |
| 133 | + |
| 134 | + with: |
| 135 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 136 | + key: ${{ runner.os }}-${{ matrix.php-version }}-composer-${{ hashFiles('composer.json') }}-symfony-skeleton-stability-${{ matrix.symfony-skeleton-stability }}-allow-failures-${{ matrix.allow-failures }} |
| 137 | + restore-keys: ${{ runner.os }}-${{ matrix.php-version }}-composer- |
| 138 | + |
| 139 | + - name: "Require symfony/flex" |
| 140 | + run: composer global require --no-progress --no-scripts --no-plugins symfony/flex dev-main |
| 141 | + |
| 142 | + - if: matrix.php-version != '8.0' |
| 143 | + run: composer update |
| 144 | + |
| 145 | + - if: matrix.php-version == '8.0' |
| 146 | + run: composer update --ignore-platform-reqs |
| 147 | + |
| 148 | + - name: "Install PHPUnit" |
| 149 | + run: vendor/bin/simple-phpunit install |
| 150 | + |
| 151 | + - name: "PHPUnit version" |
| 152 | + run: vendor/bin/simple-phpunit --version |
| 153 | + |
| 154 | + - name: "Run tests" |
| 155 | + run: vendor/bin/simple-phpunit ${{ env.PHPUNIT_FLAGS }} |
0 commit comments