Skip to content

Commit

Permalink
update unit testing
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Oct 7, 2021
1 parent 99d91a6 commit ad8d516
Showing 1 changed file with 17 additions and 21 deletions.
38 changes: 17 additions & 21 deletions .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Setup cache 2/2
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-smoke-${{ matrix.php }}-${{ matrix.type }}-${{ hashFiles('composer.json') }}
Expand All @@ -51,10 +51,6 @@ jobs:
if [ "${{ matrix.type }}" != "StaticAnalysis" ]; then composer remove --no-interaction --no-update phpstan/phpstan 'behat/*' --dev; fi
composer update --ansi --prefer-dist --no-interaction --no-progress --optimize-autoloader
- name: Init
run: |
mkdir -p build/logs
- name: "Run tests: SQLite (only for Phpunit)"
if: startsWith(matrix.type, 'Phpunit')
run: |
Expand All @@ -70,7 +66,7 @@ jobs:
- name: Run Static Analysis (only for StaticAnalysis)
if: matrix.type == 'StaticAnalysis'
run: |
echo "memory_limit = 1G" > /usr/local/etc/php/conf.d/custom-memory-limit.ini
echo "memory_limit = 2G" > /usr/local/etc/php/conf.d/custom-memory-limit.ini
vendor/bin/phpstan analyse
unit-test:
Expand Down Expand Up @@ -127,7 +123,7 @@ jobs:
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Setup cache 2/2
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.type }}-${{ hashFiles('composer.json') }}
Expand Down Expand Up @@ -185,7 +181,9 @@ jobs:
- name: Upload coverage logs 1/2 (only for latest Phpunit)
if: env.LOG_COVERAGE
run: ls -l coverage | wc -l && vendor/bin/phpcov merge coverage/ --clover coverage/merged.xml
run: |
ls -l coverage | wc -l
php -d memory_limit=2G vendor/bin/phpcov merge coverage/ --clover coverage/merged.xml
- name: Upload coverage logs 2/2 (only for latest Phpunit)
if: env.LOG_COVERAGE
Expand Down Expand Up @@ -233,7 +231,7 @@ jobs:
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Setup cache 2/2
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-behat-${{ matrix.php }}-${{ matrix.type }}-${{ hashFiles('composer.json') }}
Expand Down Expand Up @@ -290,7 +288,10 @@ jobs:
- name: Init
run: |
mkdir -p build/logs
if [ -n "$LOG_COVERAGE" ]; then
mkdir coverage
cp tools/CoverageUtil.php demos
fi
sed -i "s~'https://raw.githack.com/atk4/ui/develop/public.*~'/public',~" src/App.php
- name: "Run tests: Behat"
Expand All @@ -306,22 +307,17 @@ jobs:
sed -i 's/usleep(100000)/usleep(5000)/' vendor/behat/mink-selenium2-driver/src/Selenium2Driver.php
php demos/_demo-data/create-db.php
if [ -n "$LOG_COVERAGE" ]; then
cp tools/CoverageUtil.php demos
mkdir coverage
fi
vendor/bin/behat -vv --config behat.yml.dist
if [ -n "$LOG_COVERAGE" ]; then
ls -l coverage | wc -l && mv coverage/* build/logs
fi
- name: Upload coverage logs 1/2 (only for latest Chrome)
- name: Upload coverage logs 1/2 (only for latest Phpunit)
if: env.LOG_COVERAGE
run: vendor/bin/phpcov merge build/logs/ --clover build/logs/cc.xml
run: |
ls -l coverage | wc -l
php -d memory_limit=2G vendor/bin/phpcov merge coverage/ --clover coverage/merged.xml
- name: Upload coverage logs 2/2 (only for latest Chrome)
- name: Upload coverage logs 2/2 (only for latest Phpunit)
if: env.LOG_COVERAGE
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: build/logs/cc.xml
files: coverage/merged.xml

0 comments on commit ad8d516

Please sign in to comment.