From 7f35dc07e68d4905b3484b3746b2156a8ea1d6dd Mon Sep 17 00:00:00 2001 From: "Rafalko, Maksim" Date: Sun, 2 Jun 2024 14:01:55 +0200 Subject: [PATCH] Create GH action to run tests and SA inside docker container --- .github/workflows/ci.yaml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..9689eb5 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,34 @@ +name: 'CI: tests, static analysis' +on: + pull_request: + push: + branches: ['master'] + +env: + APP_ENV: dev + APP_SECRET: infection_ci_secret + DATABASE_ROOT_PASSWORD: root + DATABASE_PASSWORD: infection_ci_pass + DATABASE_NAME: infection_ci_playground + DATABASE_USER: infection_ci + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.2 + coverage: pcov + ini-values: xdebug.mode=off + tools: composer + + - name: Build docker image + run: docker compose up -d --build php + + - name: Run tests + run: docker-compose exec -T php vendor/bin/phpunit