3.1.2 #47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build | |
| on: | |
| push: | |
| branches: | |
| - master | |
| paths-ignore: | |
| - '**.md' | |
| pull_request: | |
| types: | |
| - opened | |
| - reopened | |
| - edited | |
| - synchronize | |
| jobs: | |
| run: | |
| runs-on: ${{ matrix.operating-system }} | |
| strategy: | |
| matrix: | |
| operating-system: [ ubuntu-20.04 ] | |
| php-versions: [ '7.3', '7.4', '8.0' ] | |
| phpunit-versions: ['latest'] | |
| env: | |
| extensions: json, simplexml, dom, pgsql, memcache | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-versions }} | |
| extensions: ${{ env.extensions }} | |
| coverage: xdebug | |
| tools: phpunit:${{ matrix.phpunit-versions }} | |
| - name: Install required packages | |
| run: | | |
| sudo apt update | |
| sudo apt purge postgresql* | |
| sudo apt install memcached postgresql -y | |
| sudo pg_lsclusters | |
| PG_VERSION=$(sudo pg_lsclusters |grep 5432|awk ' {print $1} ') | |
| PG_CLUSTER=$(sudo pg_lsclusters |grep 5432|awk ' {print $2} ') | |
| echo -e "local all postgres peer\nlocal all all trust\nhost all all 0.0.0.0/0 trust\nhost all all ::0/0 trust" | sudo tee /etc/postgresql/$PG_VERSION/$PG_CLUSTER/pg_hba.conf | |
| sudo pg_ctlcluster $PG_VERSION $PG_CLUSTER stop | |
| sudo pg_ctlcluster $PG_VERSION $PG_CLUSTER start | |
| sudo systemctl start memcached.service | |
| sudo -H -u postgres bash -c 'createdb dbd_tests' | |
| - name: Cache Composer packages | |
| id: composer-cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-php- | |
| - name: Install Composer dependencies | |
| run: composer install --prefer-dist --no-progress | |
| - name: Run test suite | |
| run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml | |
| working-directory: './' | |
| - name: Build coverage report | |
| env: | |
| COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| COVERALLS_PARALLEL: true | |
| COVERALLS_FLAG_NAME: ${{ matrix.php-versions }} | |
| run: vendor/bin/php-coveralls --verbose --coverage_clover=build/logs/clover.xml |