From a0fce81bcbea408442e9411a2bc54ae02a361e2c Mon Sep 17 00:00:00 2001 From: Julien Rajerison Date: Mon, 8 Jan 2024 16:47:50 +0300 Subject: [PATCH] Github workflows, add symfony build --- .github/workflows/symfony.yml | 62 +++++++++++++++++++++++++++++++++++ 1 file changed, 62 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..957c071 --- /dev/null +++ b/.github/workflows/symfony.yml @@ -0,0 +1,62 @@ +# 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: + 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 + - uses: shivammathur/setup-php@2cb9b829437ee246e9b3cac53555a39208ca6d28 + with: + php-version: '8.2' + + - name: Copy .env.test + run: php -r "file_exists('.env') || copy('.env.test', '.env');" + + - uses: actions/checkout@v3 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - + name: Build Docker Images + uses: docker/bake-action@v4 + with: + pull: true + load: true + files: | + compose.yaml + + - 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: | + bin/console d:d:c -e test + bin/console d:s:u -f -e test + + - name: Execute tests (Unit and Feature tests) via PHPUnit + run: bin/phpunit