Create GH action to run tests and SA inside docker container #1
Workflow file for this run
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
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 |