Skip to content

Fix incorrect option when adding TaxType to item #958

Fix incorrect option when adding TaxType to item

Fix incorrect option when adding TaxType to item #958

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.0', '8.1' ]
coverage: [ false ]
include:
- php: '7.4'
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@128a63446a954579617e875aaab7d2978154e969
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@24cb9080177205b6e8c946b17badbe402adc938f
- 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@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d
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: 14
- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
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@98814c53be79b1d30f795b907e553d8679345975
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})