-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat/php-8.0' into feat/php-8.2
- Loading branch information
Showing
7 changed files
with
221 additions
and
690 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Ci suite | ||
on: [push, pull_request] | ||
jobs: | ||
symfony: | ||
name: PHPUnit tests (PHP ${{ matrix.php-version }} - Postgres ${{ matrix.postgres-version }}) | ||
runs-on: ubuntu-latest | ||
|
||
# Docs: https://docs.github.com/en/actions/using-containerized-services | ||
services: | ||
postgres: | ||
image: postgres:${{ matrix.postgres-version }} | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: postgres | ||
ports: | ||
- 5432/tcp | ||
options: --health-cmd pg_isready --health-interval 1s --health-timeout 3s --health-retries 3 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php-version: ['7.4', '8.0'] | ||
postgres-version: ['11.20-alpine', '13.11-alpine', '15.3-alpine'] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
# Docs: https://github.com/shivammathur/setup-php | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
tools: phpunit-bridge | ||
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, pgsql | ||
coverage: xdebug | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | ||
|
||
# Without this step `git add .` command will result in exit code 128. | ||
# This ensures the comitter info is set, for now prefil with some exiting | ||
# variables in GitHub actions. | ||
|
||
- name: Set committer info | ||
id: committer-info | ||
run: | | ||
git config --global user.email ${GITHUB_ACTOR_ID}[email protected] | ||
git config --global user.name $GITHUB_ACTOR | ||
- name: Cache composer dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: Install Composer dependencies | ||
run: composer install --no-progress --prefer-dist --optimize-autoloader | ||
|
||
- name: Run Migration | ||
run: | | ||
php bin/console doctrine:migrations:migrate | ||
php bin/console messenger:setup-transports | ||
env: | ||
DATABASE_URL: postgres://postgres:[email protected]:${{ job.services.postgres.ports[5432] }}/postgres?charset=UTF-8 | ||
|
||
- name: Run tests | ||
run: php vendor/bin/phpunit --coverage-text | ||
env: | ||
DATABASE_URL: postgres://postgres:[email protected]:${{ job.services.postgres.ports[5432] }}/postgres?charset=UTF-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.