Skip to content

Migrate skeleton to Studio UI with installer profile #409

Migrate skeleton to Studio UI with installer profile

Migrate skeleton to Studio UI with installer profile #409

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:
if: github.repository == '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.5-max-5.x
- 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.5-max-5.x \
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
env:
PIMCORE_INSTANCE_IDENTIFIER: ${{ secrets.PIMCORE_CI_INSTANCE_IDENTIFIER }}
PIMCORE_ENCRYPTION_SECRET: ${{ secrets.PIMCORE_CI_ENCRYPTION_SECRET }}
PIMCORE_PRODUCT_KEY: ${{ secrets.PIMCORE_CI_PRODUCT_KEY }}
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 \
-e PIMCORE_INSTALL_ENCRYPTION_SECRET=${PIMCORE_ENCRYPTION_SECRET} \
-e PIMCORE_INSTALL_INSTANCE_IDENTIFIER=${PIMCORE_INSTANCE_IDENTIFIER} \
-e PIMCORE_INSTALL_PRODUCT_KEY=${PIMCORE_PRODUCT_KEY} \
-- \
php vendor/bin/pimcore-install -n
- name: Run codeception tests
env:
PIMCORE_INSTANCE_IDENTIFIER: ${{ secrets.PIMCORE_CI_INSTANCE_IDENTIFIER }}
PIMCORE_ENCRYPTION_SECRET: ${{ secrets.PIMCORE_CI_ENCRYPTION_SECRET }}
PIMCORE_PRODUCT_KEY: ${{ secrets.PIMCORE_CI_PRODUCT_KEY }}
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 \
-e PIMCORE_INSTALL_ADMIN_USERNAME=pimcore \
-e PIMCORE_INSTALL_ADMIN_PASSWORD=pimcore \
-e PIMCORE_INSTALL_ENCRYPTION_SECRET=${PIMCORE_ENCRYPTION_SECRET} \
-e PIMCORE_INSTALL_INSTANCE_IDENTIFIER=${PIMCORE_INSTANCE_IDENTIFIER} \
-e PIMCORE_INSTALL_PRODUCT_KEY=${PIMCORE_PRODUCT_KEY} \
test-php vendor/bin/pimcore-install -n
docker compose run --rm -T test-php vendor/bin/codecept run -vv