Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
micayael committed Jun 30, 2023
1 parent 70dd891 commit 99ee713
Show file tree
Hide file tree
Showing 3 changed files with 151 additions and 137 deletions.
43 changes: 28 additions & 15 deletions .github/workflows/symfony.yml
Expand Up @@ -16,32 +16,45 @@ permissions:

jobs:
symfony-tests:
runs-on: ubuntu-latest
runs-on: ${{ matrix.operating-system }}
name: PHP ${{ matrix.php }} and Symfony ${{ matrix.symfony }} on ${{ matrix.operating-system }}
strategy:
fail-fast: true
matrix:
operating-system: [ ubuntu-latest, windows-latest, macos-latest ]
php: [ '8.1' ]
symfony: [ '6.0.*' ]

steps:
# To automatically get bug fixes and new Php versions for shivammathur/setup-php,
# change this to (see https://github.com/shivammathur/setup-php#bookmark-versioning):
# uses: shivammathur/setup-php@v2
- uses: shivammathur/setup-php@2cb9b829437ee246e9b3cac53555a39208ca6d28
# name: Setup PHP ${{ matrix.php }}uses: shivammathur/setup-php@v2
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@2cb9b829437ee246e9b3cac53555a39208ca6d28
with:
php-version: '8.0'
php-version: ${{ matrix.php }}
tools: flex

- uses: actions/checkout@v3
- name: Copy .env.test.local
run: php -r "file_exists('.env.test.local') || copy('.env.test', '.env.test.local');"

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
${{ runner.os }}-composer-
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Create Database
run: |
mkdir -p data
touch data/database.sqlite
- name: Execute tests (Unit and Feature tests) via PHPUnit
env:
DATABASE_URL: sqlite:///%kernel.project_dir%/data/database.sqlite
SYMFONY_REQUIRE: ${{ matrix.symfony }}
# run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
uses: ramsey/composer-install@v1
with:
composer-options: "--no-progress --prefer-dist --optimize-autoloader"

- name: Run test suite
env:
SYMFONY_DEPRECATIONS_HELPER: disabled
run: vendor/bin/phpunit
122 changes: 61 additions & 61 deletions .github/workflows/symfony5.yml
@@ -1,61 +1,61 @@
name: Symfony 5

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
symfony-tests:
runs-on: ${{ matrix.operating-system }}
name: PHP ${{ matrix.php }} and Symfony ${{ matrix.symfony }} on ${{ matrix.operating-system }}
strategy:
fail-fast: true
matrix:
operating-system: [ ubuntu-latest, windows-latest, macos-latest ]
php: [ '7.4', '8.0', '8.1' ]
symfony: [ '5.1.*', '5.2.*', '5.3.*', '5.4.*' ]

steps:
- uses: actions/checkout@master

- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: flex

- name: Composer get cache directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Composer cache
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Download dependencies
env:
SYMFONY_REQUIRE: ${{ matrix.symfony }}
uses: ramsey/composer-install@v1
with:
composer-options: "--no-progress --prefer-dist --optimize-autoloader"

- name: Test symfony security
if: runner.os == 'Linux'
uses: symfonycorp/security-checker-action@v2
with:
disable-exit-code: 1
id: security-check
- name: Display the vulnerabilities as JSON
if: runner.os == 'Linux'
run: echo ${{ steps.security-check.outputs.vulns }}

- name: Run test suite
env:
SYMFONY_DEPRECATIONS_HELPER: disabled
run: ./vendor/bin/phpunit
#name: Symfony 5
#
#on:
# push:
# branches: [ master ]
# pull_request:
# branches: [ master ]
#
#jobs:
# symfony-tests:
# runs-on: ${{ matrix.operating-system }}
# name: PHP ${{ matrix.php }} and Symfony ${{ matrix.symfony }} on ${{ matrix.operating-system }}
# strategy:
# fail-fast: true
# matrix:
# operating-system: [ ubuntu-latest, windows-latest, macos-latest ]
# php: [ '7.4', '8.0', '8.1' ]
# symfony: [ '5.1.*', '5.2.*', '5.3.*', '5.4.*' ]
#
# steps:
# - uses: actions/checkout@master
#
# - name: Setup PHP ${{ matrix.php }}
# uses: shivammathur/setup-php@v2
# with:
# php-version: ${{ matrix.php }}
# tools: flex
#
# - name: Composer get cache directory
# id: composer-cache
# run: |
# echo "::set-output name=dir::$(composer config cache-files-dir)"
# - name: Composer cache
# uses: actions/cache@v2
# with:
# path: ${{ steps.composer-cache.outputs.dir }}
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
# restore-keys: |
# ${{ runner.os }}-composer-
#
# - name: Download dependencies
# env:
# SYMFONY_REQUIRE: ${{ matrix.symfony }}
# uses: ramsey/composer-install@v1
# with:
# composer-options: "--no-progress --prefer-dist --optimize-autoloader"
#
# - name: Test symfony security
# if: runner.os == 'Linux'
# uses: symfonycorp/security-checker-action@v2
# with:
# disable-exit-code: 1
# id: security-check
# - name: Display the vulnerabilities as JSON
# if: runner.os == 'Linux'
# run: echo ${{ steps.security-check.outputs.vulns }}
#
# - name: Run test suite
# env:
# SYMFONY_DEPRECATIONS_HELPER: disabled
# run: ./vendor/bin/phpunit
123 changes: 62 additions & 61 deletions .github/workflows/symfony6.yml
@@ -1,61 +1,62 @@
name: Symfony 6

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
symfony-tests:
runs-on: ${{ matrix.operating-system }}
name: PHP ${{ matrix.php }} and Symfony ${{ matrix.symfony }} on ${{ matrix.operating-system }}
strategy:
fail-fast: true
matrix:
operating-system: [ ubuntu-latest, windows-latest, macos-latest ]
php: [ '8.1' ]
symfony: [ '6.0.*' ]

steps:
- uses: actions/checkout@master

- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@2cb9b829437ee246e9b3cac53555a39208ca6d28
with:
php-version: ${{ matrix.php }}
tools: flex

- name: Composer get cache directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Composer cache
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Download dependencies
env:
SYMFONY_REQUIRE: ${{ matrix.symfony }}
uses: ramsey/composer-install@v1
with:
composer-options: "--no-progress --prefer-dist --optimize-autoloader"

- name: Test symfony security
if: runner.os == 'Linux'
uses: symfonycorp/security-checker-action@v2
with:
disable-exit-code: 1
id: security-check
- name: Display the vulnerabilities as JSON
if: runner.os == 'Linux'
run: echo ${{ steps.security-check.outputs.vulns }}

- name: Run test suite
env:
SYMFONY_DEPRECATIONS_HELPER: disabled
run: ./vendor/bin/phpunit
#name: Symfony 6
#
#on:
# push:
# branches: [ master ]
# pull_request:
# branches: [ master ]
#
#jobs:
# symfony-tests:
# runs-on: ${{ matrix.operating-system }}
# name: PHP ${{ matrix.php }} and Symfony ${{ matrix.symfony }} on ${{ matrix.operating-system }}
# strategy:
# fail-fast: true
# matrix:
# operating-system: [ ubuntu-latest, windows-latest, macos-latest ]
# php: [ '8.1' ]
# symfony: [ '6.0.*' ]
#
# steps:
# - uses: actions/checkout@master
#
# - name: Setup PHP ${{ matrix.php }}
# uses: shivammathur/setup-php@2cb9b829437ee246e9b3cac53555a39208ca6d28
# with:
# php-version: ${{ matrix.php }}
# tools: flex
#
# - name: Composer get cache directory
# id: composer-cache
# run: |
# echo "::set-output name=dir::$(composer config cache-files-dir)"
#
# - name: Composer cache
# uses: actions/cache@v3
# with:
# path: ${{ steps.composer-cache.outputs.dir }}
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
# restore-keys: |
# ${{ runner.os }}-composer-
#
# - name: Download dependencies
# env:
# SYMFONY_REQUIRE: ${{ matrix.symfony }}
# uses: ramsey/composer-install@v1
# with:
# composer-options: "--no-progress --prefer-dist --optimize-autoloader"
#
# - name: Test symfony security
# if: runner.os == 'Linux'
# uses: symfonycorp/security-checker-action@v2
# with:
# disable-exit-code: 1
# id: security-check
# - name: Display the vulnerabilities as JSON
# if: runner.os == 'Linux'
# run: echo ${{ steps.security-check.outputs.vulns }}
#
# - name: Run test suite
# env:
# SYMFONY_DEPRECATIONS_HELPER: disabled
# run: ./vendor/bin/phpunit

0 comments on commit 99ee713

Please sign in to comment.