Skip to content

Added Docker Compose support to simplify local development #611

Added Docker Compose support to simplify local development

Added Docker Compose support to simplify local development #611

Workflow file for this run

name: ci
on:
push:
branches:
- '*.x'
tags:
- '*'
pull_request:
schedule:
- cron: '0 0 * * *'
jobs:
ci:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
include:
- php: '8.4'
stability: prefer-stable
name: PHP ${{ matrix.php }} - ${{ matrix.stability }}
steps:
- name: Check Out Code
uses: actions/checkout@v4
- name: Set Up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, dom, libxml, mbstring, pcntl, sqlite3, xdebug, zip
tools: composer:v2
coverage: xdebug
- name: Install Dependencies
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress --ignore-platform-reqs
- name: Run Tests
run: composer phpunit
#- name: Run Linter
# run: composer phpcs-test
#- name: Run Psalm Static Analysis
# run: composer psalm -- --shepherd
- name: Upload Coverage Results To Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer global require php-coveralls/php-coveralls
php-coveralls --coverage_clover=./.coverage/clover.xml --json_path=./coveralls-upload.json -v
docker-ci:
runs-on: ubuntu-latest
name: Run Tests in Docker
steps:
- name: Check Out Code
uses: actions/checkout@v4
- name: Set Up Docker
uses: docker/setup-buildx-action@v2
- name: Install Docker Compose
run: |
sudo curl -L "https://github.com/docker/compose/releases/download/2.31.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker compose --version
- name: Build Docker Images
run: docker compose build
- name: Start Docker Compose
run: docker compose up -d
- name: Run Tests Inside PHP Container
run: docker compose run --rm composer phpunit
- name: Stop Docker Compose
if: always()
run: docker compose down