From 18944758d021855de72bd74c833a04ff2bb97e08 Mon Sep 17 00:00:00 2001 From: Faez Bhatti <59208895+Faez-B@users.noreply.github.com> Date: Sun, 30 Jun 2024 10:09:27 +0200 Subject: [PATCH] Create symfony.yml First test --- .github/workflows/symfony.yml | 60 +++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/symfony.yml diff --git a/.github/workflows/symfony.yml b/.github/workflows/symfony.yml new file mode 100644 index 0000000..1a5cb3f --- /dev/null +++ b/.github/workflows/symfony.yml @@ -0,0 +1,60 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Symfony + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +permissions: + contents: read + +jobs: + # This job is inspired by php.yml workflow + validate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Validate composer.json and composer.lock + run: composer validate --strict + + symfony-tests: + runs-on: ubuntu-latest + 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 + with: + php-version: '8.1' + - uses: actions/checkout@v4 + + - 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') }} + restore-keys: | + ${{ runner.os }}-php- + + - 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 + run: vendor/bin/phpunit