| 
 | 1 | +name: tests  | 
 | 2 | + | 
 | 3 | +on:  | 
 | 4 | +  push:  | 
 | 5 | + | 
 | 6 | +jobs:  | 
 | 7 | +  tests:  | 
 | 8 | +    runs-on: ubuntu-20.04  | 
 | 9 | + | 
 | 10 | +    strategy:  | 
 | 11 | +      fail-fast: true  | 
 | 12 | +      matrix:  | 
 | 13 | +        php: [7.3, 7.4]  | 
 | 14 | +        stability: [prefer-lowest, prefer-stable]  | 
 | 15 | + | 
 | 16 | +    name: PHP ${{ matrix.php }} - ${{ matrix.stability }}  | 
 | 17 | + | 
 | 18 | +    steps:  | 
 | 19 | +      - name: Checkout code  | 
 | 20 | +        uses: actions/checkout@v2  | 
 | 21 | +      - name: Cache dependencies  | 
 | 22 | +        uses: actions/cache@v2  | 
 | 23 | +        with:  | 
 | 24 | +          path: ~/.composer/cache/files  | 
 | 25 | +          key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}  | 
 | 26 | +      - name: Download Percona Repo  | 
 | 27 | +        run: wget --quiet https://repo.percona.com/apt/percona-release_latest.generic_all.deb  | 
 | 28 | +      - name: Install Percona Repo  | 
 | 29 | +        run: sudo dpkg -i percona-release_latest.generic_all.deb  | 
 | 30 | +      - name: Install Percona Toolkit  | 
 | 31 | +        run: sudo apt-get install -y -qq percona-toolkit  | 
 | 32 | +      - name: Workaround outdated PTOSC validation  | 
 | 33 | +        run: sudo sed -i -r -e 's/^([ \t]*if \()(\$vp->cmp\()/\1 0 \&\& \2/g' /usr/bin/pt-online-schema-change  | 
 | 34 | +      - name: Start Mysql  | 
 | 35 | +        run: sudo systemctl start mysql  | 
 | 36 | +      - name: Create Mysql DB  | 
 | 37 | +        run: mysql --user=root --password=root --host=127.0.0.1 -e 'CREATE DATABASE IF NOT EXISTS online_migrator_ci;'  | 
 | 38 | +      - name: Workaround PHP 7.3 not supporting newer authentication  | 
 | 39 | +        run: mysql --user=root --password=root --host=127.0.0.1 -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root'; FLUSH PRIVILEGES;"  | 
 | 40 | +      - name: Setup PHP  | 
 | 41 | +        uses: shivammathur/setup-php@v2  | 
 | 42 | +        with:  | 
 | 43 | +          php-version: ${{ matrix.php }}  | 
 | 44 | +          extensions: pdo, pdo_mysql  | 
 | 45 | +          coverage: none  | 
 | 46 | +      - name: Composer update  | 
 | 47 | +        run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress  | 
 | 48 | +      - name: Execute tests  | 
 | 49 | +        run: vendor/bin/phpunit --testdox --configuration phpunit.xml.github  | 
0 commit comments