Skip to content

Commit

Permalink
[Tests] move to Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
solverat committed Dec 7, 2020
1 parent cd8e6d1 commit 4a604d2
Show file tree
Hide file tree
Showing 30 changed files with 571 additions and 419 deletions.
1 change: 1 addition & 0 deletions .actrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-P ubuntu-latest=gitlab-actions:latest
121 changes: 121 additions & 0 deletions .github/workflows/codeception.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: Codeception
on:
push:
branches: [ 'master' ]
pull_request:
branches: [ 'master' ]

jobs:
codeception:
runs-on: ubuntu-latest
env:
DACHCOM_BUNDLE_TEST_DIR: "${{ github.workspace }}/tests"
DACHCOM_BUNDLE_NAME: "DynamicSearchBundle"
DACHCOM_BUNDLE_CLASS: "DynamicSearchBundle\\DynamicSearchBundle"
DACHCOM_BUNDLE_INSTALLER_CLASS: "DynamicSearchBundle\\Tool\\Install"

PIMCORE_ENVIRONMENT: "test"
PIMCORE_TEST_DB_DSN: "mysql://root:root@localhost/dachcom_bundle_test"
PIMCORE_TEST_URL: "http://localhost"

SYMFONY_DEPRECATIONS_HELPER: "weak"
PIMCORE_PHP_ERROR_REPORTING: 32767

MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: dachcom_bundle_test
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: dachcom_bundle_test
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
matrix:
php: [7.4]
symfony: [^4.4]
pimcore: [ ^6.6, ^6.7, ^6.8]
include:
- pimcore: ^6.6
template_tag: v2.6.0
- pimcore: ^6.7
template_tag: v2.7.0
- pimcore: ^6.8
template_tag: v2.8.0
steps:
- uses: actions/checkout@v2

- name: Generate Application Structure
run: |
git clone -b ${{ matrix.template_tag }} --single-branch --depth 1 https://github.com/pimcore/skeleton.git
mv skeleton/app .
mv skeleton/bin .
mv skeleton/var .
mv skeleton/web .
mv skeleton/src/AppBundle src
- name: Setup Bundle
env:
MATRIX_PIMCORE_VERSION: ${{ matrix.pimcore }}
MATRIX_PIMCORE_TEMPLATE_TAG: ${{ matrix.template_tag }}
run: |
chmod +x tests/_etc/scripts/install
./tests/_etc/scripts/install
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: intl
coverage: none

- name: Check PHP Version
run: php -v

- name: Start MySql Service
run: |
sudo /etc/init.d/mysql start
- name: Verify MySql Connection
run: |
sudo apt-get update
sudo apt-get install -y mysql-client-5.7
mysql -uroot -h127.0.0.1 -proot -e "SHOW DATABASES"
- name: Setup MySql
run: |
mysql -uroot -h127.0.0.1 -proot -e "SET GLOBAL innodb_file_format=Barracuda;"
mysql -uroot -h127.0.0.1 -proot -e "SET GLOBAL innodb_large_prefix=1;"
mysql -uroot -h127.0.0.1 -proot -e "CREATE DATABASE dachcom_bundle_test CHARSET=utf8mb4;"
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache Composer Downloads
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Composer install
run: |
composer req pimcore/pimcore:${{ matrix.pimcore }} symfony/symfony:${{ matrix.symfony }} --no-interaction --ignore-platform-reqs --no-scripts
composer install --no-progress --prefer-dist --optimize-autoloader --ignore-platform-reqs
- name: Tests
run: |
echo "127.0.0.1 test-domain1.test" | sudo tee -a /etc/hosts
echo "127.0.0.1 test-domain2.test" | sudo tee -a /etc/hosts
echo "127.0.0.1 test-domain3.test" | sudo tee -a /etc/hosts
echo "127.0.0.1 test-domain4.test" | sudo tee -a /etc/hosts
echo "127.0.0.1 test-domain5.test" | sudo tee -a /etc/hosts
echo "127.0.0.1 test-domain6.test" | sudo tee -a /etc/hosts
echo "127.0.0.1 test-domain7.test" | sudo tee -a /etc/hosts
bin/console cache:warmup --env=test
vendor/bin/codecept run --env github -c ${{ env.GITHUB_WORKSPACE }}
106 changes: 106 additions & 0 deletions .github/workflows/ecs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Easy Coding Standards
on:
push:
branches: [ 'master' ]
pull_request:
branches: [ 'master' ]

jobs:
ecs:
runs-on: ubuntu-latest
env:
PIMCORE_ENVIRONMENT: "test"
PIMCORE_TEST_DB_DSN: "mysql://root:root@localhost/dachcom_bundle_test"
PIMCORE_TEST_URL: "http://localhost"
SYMFONY_DEPRECATIONS_HELPER: "weak"

MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: dachcom_bundle_test

services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: dachcom_bundle_test
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
matrix:
php: [7.4]
symfony: [^4.4]
pimcore: [^6.8]
include:
- pimcore: ^6.8
template_tag: v2.8.0

steps:
- uses: actions/checkout@v2

- name: Generate Application Structure
run: |
git clone -b ${{ matrix.template_tag }} --single-branch --depth 1 https://github.com/pimcore/skeleton.git
mv skeleton/app .
mv skeleton/bin .
mv skeleton/var .
mv skeleton/web .
mv skeleton/src/AppBundle src
- name: Setup Bundle
env:
MATRIX_PIMCORE_VERSION: ${{ matrix.pimcore }}
MATRIX_PIMCORE_TEMPLATE_TAG: ${{ matrix.template_tag }}
run: |
chmod +x tests/_etc/scripts/install
./tests/_etc/scripts/install
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: intl
coverage: none

- name: Check PHP Version
run: php -v

- name: Start MySql Service
run: |
sudo /etc/init.d/mysql start
- name: Verify MySql Connection

This comment has been minimized.

Copy link
@dpfaffenbauer

dpfaffenbauer Dec 7, 2020

Contributor

not necessary for ecs.

run: |
sudo apt-get update
sudo apt-get install -y mysql-client-5.7
mysql -uroot -h127.0.0.1 -proot -e "SHOW DATABASES"
- name: Setup MySql
run: |
mysql -uroot -h127.0.0.1 -proot -e "SET GLOBAL innodb_file_format=Barracuda;"
mysql -uroot -h127.0.0.1 -proot -e "SET GLOBAL innodb_large_prefix=1;"
mysql -uroot -h127.0.0.1 -proot -e "CREATE DATABASE dachcom_bundle_test CHARSET=utf8mb4;"
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache Composer Downloads
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Composer install
run: |
composer req pimcore/pimcore:${{ matrix.pimcore }} symfony/symfony:${{ matrix.symfony }} --no-interaction --ignore-platform-reqs --no-scripts
composer install --no-progress --prefer-dist --optimize-autoloader --ignore-platform-reqs
- name: Easy Coding Standard Check
continue-on-error: true
run: |
bin/console cache:warmup --env=test
vendor/bin/ecs check src --config easy-coding-standard.yml
106 changes: 106 additions & 0 deletions .github/workflows/php-stan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: PHP Stan
on:
push:
branches: [ 'master' ]
pull_request:
branches: [ 'master' ]

jobs:
stan:
runs-on: ubuntu-latest
env:
PIMCORE_ENVIRONMENT: "test"
PIMCORE_TEST_DB_DSN: "mysql://root:root@localhost/dachcom_bundle_test"
PIMCORE_TEST_URL: "http://localhost"
SYMFONY_DEPRECATIONS_HELPER: "weak"
PIMCORE_PHP_ERROR_REPORTING: 32767

MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: dachcom_bundle_test

services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: dachcom_bundle_test
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
matrix:
php: [7.4]
symfony: [^4.4]
pimcore: [^6.8]
include:
- pimcore: ^6.8
template_tag: v2.8.0

steps:
- uses: actions/checkout@v2

- name: Generate Application Structure
run: |
git clone -b ${{ matrix.template_tag }} --single-branch --depth 1 https://github.com/pimcore/skeleton.git
mv skeleton/app .
mv skeleton/bin .
mv skeleton/var .
mv skeleton/web .
mv skeleton/src/AppBundle src
- name: Setup Bundle
env:
MATRIX_PIMCORE_VERSION: ${{ matrix.pimcore }}
MATRIX_PIMCORE_TEMPLATE_TAG: ${{ matrix.template_tag }}
run: |
chmod +x tests/_etc/scripts/install
./tests/_etc/scripts/install
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: intl
coverage: none

- name: Check PHP Version
run: php -v

- name: Start MySql Service
run: |
sudo /etc/init.d/mysql start
- name: Verify MySql Connection
run: |
sudo apt-get update
sudo apt-get install -y mysql-client-5.7
mysql -uroot -h127.0.0.1 -proot -e "SHOW DATABASES"
- name: Setup MySql
run: |
mysql -uroot -h127.0.0.1 -proot -e "SET GLOBAL innodb_file_format=Barracuda;"
mysql -uroot -h127.0.0.1 -proot -e "SET GLOBAL innodb_large_prefix=1;"
mysql -uroot -h127.0.0.1 -proot -e "CREATE DATABASE dachcom_bundle_test CHARSET=utf8mb4;"
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache Composer Downloads
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Composer install
run: |
composer req pimcore/pimcore:${{ matrix.pimcore }} symfony/symfony:${{ matrix.symfony }} --no-interaction --ignore-platform-reqs --no-scripts
composer install --no-progress --prefer-dist --optimize-autoloader --ignore-platform-reqs
- name: Php Stan
run: |
bin/console cache:warmup --env=test
vendor/bin/phpstan analyse -c phpstan.neon -a tests/_phpstan-bootstrap.php src -l 2
Loading

0 comments on commit 4a604d2

Please sign in to comment.