Skip to content

Prepare 2024.3 (#201) #267

Prepare 2024.3 (#201)

Prepare 2024.3 (#201) #267

name: Test Pimcore Skeleton
on:
pull_request:
branches:
- "[0-9]+.[0-9]+"
- "[0-9]+.x"
push:
branches:
- "[0-9]+.[0-9]+"
- "[0-9]+.x"
- "*_actions"
jobs:
test-pimcore-skeleton:
runs-on: ubuntu-latest
steps:
# Check out the repo in a sub-dir to see if it can serve as
# teplate for `composer create-project`
# See: https://github.com/actions/checkout#usage
- uses: actions/checkout@v2
with:
path: 'skeleton'
- name: Pull latest pimcore image
run: |
# Echo commands and terminate on first error
set -ex
# Pull latest build of pimcore's image
docker pull docker.io/pimcore/pimcore:php8.2-latest
- name: Create project from skeleton in latest pimcore environment
run: |
# Echo commands and terminate on first error
set -ex
# Try creating a new project with composer using contents of this repo as the package.
# We execute composer within docker container to suttisfy platform requirements.
# The value of ´"url":` must match checkout path in the first step.
#
# See: https://getcomposer.org/doc/03-cli.md#create-project
# See: https://getcomposer.org/doc/05-repositories.md#path
docker run \
--volume=${{ github.workspace }}/:/test/ \
--workdir=/test/ \
--user=$(id -u):$(id -g) \
docker.io/pimcore/pimcore:php8.2-latest \
composer create-project \
pimcore/skeleton:@dev \
--repository='{"type": "path", "url": "./skeleton"}' \
sample-project
- name: Smoke-test compose file
run: |
# Echo commands and terminate on first error
set -ex
# Check (lint) the compose file
docker compose version
cd sample-project/
docker compose config -q
- name: Test pimcore installation
run: |
# Echo commands and terminate on first error
set -ex
cd sample-project/
# Set up docker-compose.yaml to use current user's uid:gid, just like README.md suggests.
sed -i "s|#user: '1000:1000'|user: '$(id -u):$(id -g)'|g" docker-compose.yaml
# Start containers
docker compose pull --quiet
docker compose up -d
# Run pimcore installation.
docker compose exec -T \
-e PIMCORE_INSTALL_ADMIN_USERNAME=pimcore \
-e PIMCORE_INSTALL_ADMIN_PASSWORD=pimcore \
-- \
php vendor/bin/pimcore-install -n
- name: Run codeception tests
run: |
# Echo commands and terminate on first error
set -ex
cd sample-project/
# Set up and execute codeception tests, just like README.md suggests.
docker compose run --user=root --rm test-php chown -R $(id -u):$(id -g) var/ public/var/
docker compose run --rm -T test-php vendor/bin/pimcore-install -n
docker compose run --rm -T test-php vendor/bin/codecept run -vv