Skip to content

Bump codecov/codecov-action from 4.3.0 to 4.3.1 #1169

Bump codecov/codecov-action from 4.3.0 to 4.3.1

Bump codecov/codecov-action from 4.3.0 to 4.3.1 #1169

Workflow file for this run

name: Unit Tests
on:
pull_request:
push:
branches:
- 2.3.x
jobs:
unit:
name: Unit ( PHP ${{ matrix.php }} )
runs-on: ubuntu-latest
strategy:
matrix:
php: [ '8.1', '8.2' ]
coverage: [ false ]
include:
- php: '8.3'
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@63c24ba6bd7ba022e95695ff85de572c04a18142
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@0ad4b8fadaa221de15dcec353f45205ec38ea70b
- uses: haya14busa/action-cond@94f77f7a80cd666cb3155084e428254fea4281fd
id: coverage_driver
with:
cond: ${{ matrix.coverage }}
if_true: pcov
if_false: none
- name: Setup PHP
uses: shivammathur/setup-php@c665c7a15b5295c2488ac8a87af9cb806cd72198
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: oven-sh/setup-bun@v1
- uses: ramsey/composer-install@v3
- name: Detect browser drivers
run: bin/bdi detect drivers
- run: bun install
- run: bun run 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 Codecov
uses: codecov/codecov-action@5ecb98a3c6b747ed38dc09f787459979aebb39be
if: matrix.coverage
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: build/logs/clover.xml
flags: unittests
fail_ci_if_error: true
verbose: true
- name: Add comment to PR with failure screenshots
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
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})