Skip to content

chore: make use ofprofiles in docker-compose.yml #120

chore: make use ofprofiles in docker-compose.yml

chore: make use ofprofiles in docker-compose.yml #120

Workflow file for this run

name: Test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
name: PHP ${{ matrix.php-version }} / WP ${{ matrix.wp-version }}
runs-on: ubuntu-24.04
strategy:
matrix:
php-version: ['7.4', '8.0', '8.1', '8.2']
wp-version: ['6.4.3', '6.3.5', '6.2.4']
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ matrix.php-version }}-${{ hashFiles('tests/Dockerfile') }}
restore-keys: |
${{ runner.os }}-buildx-${{ matrix.php-version }}-
${{ runner.os }}-buildx-
- name: Build and run tests
id: phpunit
shell: bash
run: |
docker buildx build \
--file tests/Dockerfile \
--build-arg PHP_VERSION=${{ matrix.php-version }} \
--cache-from type=local,src=/tmp/.buildx-cache \
--cache-to type=local,dest=/tmp/.buildx-cache,mode=max \
--load \
-t wordpress-test .
WP_VERSION=${{ matrix.wp-version }} docker compose run --rm wordpress-test sh -c "composer install && ./vendor/bin/phpunit"