Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
jnvsor committed Aug 21, 2024
1 parent 8decdc0 commit 31ce2f9
Showing 1 changed file with 114 additions and 114 deletions.
228 changes: 114 additions & 114 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,122 +4,122 @@
name: Tests
on: [push, pull_request]
jobs:
test-format:
name: 'Code format check'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- uses: shivammathur/setup-php@v2
with:
php-version: 8.3
- uses: actions/cache@v4
id: vendor-caches
with:
path: |
./vendor
./node_modules
key: ${{ hashFiles('./composer.lock', './package-lock.json') }}
- run: composer install
if: steps.vendor-caches.outputs.cache-hit != 'true'
- run: composer format
env:
PHP_CS_FIXER_IGNORE_ENV: 1
- run: git status
- run: git diff-files --quiet --exit-code
test-build:
name: 'Build check'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- uses: shivammathur/setup-php@v2
with:
php-version: 8.3
ini-values: 'phar.readonly=Off'
- uses: actions/cache@v4
id: vendor-caches
with:
path: |
./vendor
./node_modules
key: ${{ hashFiles('./composer.lock', './package-lock.json') }}
- run: composer install
if: steps.vendor-caches.outputs.cache-hit != 'true'
- run: composer clean
- run: composer build
- run: git status
- run: git diff-files --quiet --exit-code
test-static:
name: 'Static analysis check'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- uses: shivammathur/setup-php@v2
with:
php-version: 8.3
- uses: actions/cache@v4
id: vendor-caches
with:
path: |
./vendor
./node_modules
key: ${{ hashFiles('./composer.lock', './package-lock.json') }}
- run: composer install
if: steps.vendor-caches.outputs.cache-hit != 'true'
- run: composer analyze
test-basic:
name: 'Basic test ${{ matrix.php-coverage }}'
runs-on: ubuntu-latest
services:
mysql:
image: mysql:latest
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
ports:
- 3306
# Should increase test consistency by ensuring mysql actually starts up properly
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
strategy:
matrix:
php-coverage:
- none
- xdebug
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- uses: shivammathur/setup-php@v2
with:
php-version: 8.3
coverage: ${{ matrix.php-coverage }}
- uses: actions/cache@v4
id: vendor-caches
with:
path: |
./vendor
./node_modules
key: ${{ hashFiles('./composer.lock', './package-lock.json') }}
- run: composer install
if: steps.vendor-caches.outputs.cache-hit != 'true'
- run: php ./vendor/bin/phpunit tests
env:
MYSQLI_HOST: localhost:${{ job.services.mysql.ports['3306'] }}
# test-format:
# name: 'Code format check'
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# with:
# node-version: latest
# - uses: shivammathur/setup-php@v2
# with:
# php-version: 8.3
# - uses: actions/cache@v4
# id: vendor-caches
# with:
# path: |
# ./vendor
# ./node_modules
# key: ${{ hashFiles('./composer.lock', './package-lock.json') }}
# - run: composer install
# if: steps.vendor-caches.outputs.cache-hit != 'true'
# - run: composer format
# env:
# PHP_CS_FIXER_IGNORE_ENV: 1
# - run: git status
# - run: git diff-files --quiet --exit-code
# test-build:
# name: 'Build check'
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# with:
# node-version: latest
# - uses: shivammathur/setup-php@v2
# with:
# php-version: 8.3
# ini-values: 'phar.readonly=Off'
# - uses: actions/cache@v4
# id: vendor-caches
# with:
# path: |
# ./vendor
# ./node_modules
# key: ${{ hashFiles('./composer.lock', './package-lock.json') }}
# - run: composer install
# if: steps.vendor-caches.outputs.cache-hit != 'true'
# - run: composer clean
# - run: composer build
# - run: git status
# - run: git diff-files --quiet --exit-code
# test-static:
# name: 'Static analysis check'
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# with:
# node-version: latest
# - uses: shivammathur/setup-php@v2
# with:
# php-version: 8.3
# - uses: actions/cache@v4
# id: vendor-caches
# with:
# path: |
# ./vendor
# ./node_modules
# key: ${{ hashFiles('./composer.lock', './package-lock.json') }}
# - run: composer install
# if: steps.vendor-caches.outputs.cache-hit != 'true'
# - run: composer analyze
# test-basic:
# name: 'Basic test ${{ matrix.php-coverage }}'
# runs-on: ubuntu-latest
# services:
# mysql:
# image: mysql:latest
# env:
# MYSQL_ALLOW_EMPTY_PASSWORD: yes
# ports:
# - 3306
# # Should increase test consistency by ensuring mysql actually starts up properly
# options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
# strategy:
# matrix:
# php-coverage:
# - none
# - xdebug
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# with:
# node-version: latest
# - uses: shivammathur/setup-php@v2
# with:
# php-version: 8.3
# coverage: ${{ matrix.php-coverage }}
# - uses: actions/cache@v4
# id: vendor-caches
# with:
# path: |
# ./vendor
# ./node_modules
# key: ${{ hashFiles('./composer.lock', './package-lock.json') }}
# - run: composer install
# if: steps.vendor-caches.outputs.cache-hit != 'true'
# - run: php ./vendor/bin/phpunit tests
# env:
# MYSQLI_HOST: localhost:${{ job.services.mysql.ports['3306'] }}
tests:
name: 'PHP ${{ matrix.php-versions }} ${{ matrix.phar }}tests'
needs:
- test-format
- test-build
- test-static
- test-basic
# needs:
# - test-format
# - test-build
# - test-static
# - test-basic
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down

0 comments on commit 31ce2f9

Please sign in to comment.