Skip to content

Bump shivammathur/setup-php from 2.25.2 to 2.30.2 #982

Bump shivammathur/setup-php from 2.25.2 to 2.30.2

Bump shivammathur/setup-php from 2.25.2 to 2.30.2 #982

Workflow file for this run

name: Unit Tests
on: [ pull_request ]
jobs:
unit:
name: Unit ( PHP ${{ matrix.php }} )
runs-on: ubuntu-latest
strategy:
matrix:
php: [ '8.2' ]
coverage: [ false ]
include:
- php: '8.1'
coverage: true
fail-fast: false
env:
SOLIDINVOICE_ENV: test
SOLIDINVOICE_DEBUG: 0
PANTHER_NO_HEADLESS: 0
PANTHER_APP_ENV: test
PANTHER_NO_SANDBOX: 1
PANTHER_CHROME_ARGUMENTS: --disable-dev-shm-usage
COVERAGE: 0
database_driver: pdo_mysql
database_host: 127.0.0.1
database_port: 3306
database_name: solidinvoice
database_user: root
database_password:
database_version: 8.0
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: solidinvoice_test
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Harden Runner
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09
with:
egress-policy: block
allowed-endpoints: >
api.github.com:443
chromedriver.storage.googleapis.com:443
codecov.io:443
coveralls.io:443
github.com:443
objects.githubusercontent.com:443
packagist.org:443
registry.yarnpkg.com:443
repo.packagist.org:443
storage.googleapis.com:443
uploader.codecov.io:443
54.185.253.63:443
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
- uses: haya14busa/action-cond@1d6e8a12b20cdb4f1954feef9aa475b9c390cab5
id: coverage_driver
with:
cond: ${{ matrix.coverage }}
if_true: pcov
if_false: none
- name: Setup PHP
uses: shivammathur/setup-php@8872c784b04a1420e81191df5d64fbd59d3d3033
with:
php-version: ${{ matrix.php }}
ini-values: date.timezone=Africa/Johannesburg, opcache.enable=1, opcache.enable_cli=1, opcache.memory_consumption=256, opcache.max_accelerated_files=32531, opcache.interned_strings_buffer=8, opcache.validate_timestamps=0, opcache.save_comments=1, opcache.fast_shutdown=0, memory_limit=-1
extensions: intl, gd, opcache, mysql, pdo_mysql, soap, zip, :xdebug
coverage: ${{ steps.coverage_driver.outputs.value }}
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
with:
node-version-file: .nvmrc
- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json composer.lock') }}
restore-keys: ${{ runner.os }}-php-${{ matrix.php }}-composer-
- name: Install dependencies
run: composer install --ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Downgrade dbrekelmans/bdi on PHP < 8.1
if: matrix.php < '8.1'
run: composer require --ansi --no-interaction --no-progress --prefer-dist dbrekelmans/bdi:1.0.4
- name: Detect browser drivers
run: bin/bdi detect drivers
- run: yarn install
- run: yarn build
- name: Enable code coverage
if: matrix.coverage
run: echo "COVERAGE=1" >> $GITHUB_ENV
- name: Run test suite
run: |
mkdir -p build/logs
if [ "$COVERAGE" = '1' ]; then
bin/phpunit --coverage-clover build/logs/clover.xml
else
bin/phpunit
fi
- name: Upload coverage results to Coveralls
if: matrix.coverage
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer global require --prefer-dist --no-interaction --no-progress --ansi php-coveralls/php-coveralls
export PATH="$PATH:$HOME/.composer/vendor/bin"
php-coveralls --coverage_clover=build/logs/clover.xml -v
- name: Upload coverage results to Codecov
uses: codecov/codecov-action@v3
if: matrix.coverage
with:
files: build/logs/clover.xml
flags: unittests # optional
name: codecov-umbrella # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
- name: Add comment to PR with failure screenshots
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410
if: ${{ failure() }}
env:
CLOUDINARY_URL: cloudinary://${{ secrets.CLOUDINARY_API_KEY }}:${{ secrets.CLOUDINARY_API_SECRET }}@${{ secrets.CLOUDINARY_CLOUD_NAME }}
JOB_NAME: Unit ( PHP ${{ matrix.php }} )
with:
script: |
const script = require('./scripts/e2e-failure.js')
await script({github, context, core})