OXDEV-7758 Remove dead schema link from readme #183
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Development | |
on: [ push, pull_request ] | |
jobs: | |
install_shop_with_module: | |
strategy: | |
matrix: | |
php: [ '7.4', '8.0' ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone testing environment | |
run: git clone https://github.com/OXID-eSales/docker-eshop-sdk.git . | |
- name: Clone the shop | |
run: git clone --depth 1 https://github.com/OXID-eSales/oxideshop_ce.git --branch b-6.5.x --single-branch source | |
- name: Cache current installation | |
uses: actions/cache@v2 | |
with: | |
path: | | |
./* | |
key: shopInstallation-${{ matrix.php }}-${{ github.sha }} | |
- name: Prepare container configuration | |
run: | | |
make setup | |
make addbasicservices | |
perl -pi\ | |
-e "s#PHP_VERSION=.*#PHP_VERSION='${{ matrix.php }}'#g;"\ | |
.env | |
perl -pi\ | |
-e 's#display_errors =.*#display_errors = false#g;'\ | |
-e 'print "xdebug.max_nesting_level=1000\nxdebug.mode=coverage\n\n"'\ | |
containers/php/custom.ini | |
perl -pi\ | |
-e 's#/var/www/#/var/www/source/#g;'\ | |
containers/httpd/project.conf | |
- name: Prepare shop configuration | |
run: | | |
cp source/source/config.inc.php.dist source/source/config.inc.php | |
perl -pi\ | |
-e 'print "SetEnvIf Authorization \"(.*)\" HTTP_AUTHORIZATION=\$1\n\n" if $. == 1'\ | |
source/source/.htaccess | |
perl -pi\ | |
-e 's#<dbHost>#mysql#g;'\ | |
-e 's#<dbUser>#root#g;'\ | |
-e 's#<dbName>#example#g;'\ | |
-e 's#<dbPwd>#root#g;'\ | |
-e 's#<dbPort>#3306#g;'\ | |
-e 's#<sShopURL>#http://localhost.local/#g;'\ | |
-e 's#<sShopDir>#/var/www/source/#g;'\ | |
-e 's#<sCompileDir>#/var/www/source/tmp/#g;'\ | |
source/source/config.inc.php | |
- name: Checkout current module | |
uses: actions/checkout@v2 | |
with: | |
path: source/test-module | |
- name: Start containers | |
run: | | |
make up | |
sleep 2 | |
- name: Install module | |
run: | | |
docker-compose exec -T \ | |
php composer config repositories.oxid-esales/grapqhl-base \ | |
--json '{"type":"path", "url":"./test-module", "options": {"symlink": true}}' | |
docker-compose exec -T \ | |
php composer require oxid-esales/graphql-base:* --no-interaction | |
- name: Install dependencies | |
run: docker-compose exec -T php composer update --no-interaction | |
- name: Reset shop | |
run: docker-compose exec -T php php vendor/bin/reset-shop | |
- name: Stop containers | |
run: | | |
docker-compose down | |
sleep 2 | |
styles: | |
strategy: | |
matrix: | |
php: [ '8.0' ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout current module | |
uses: actions/checkout@v2 | |
with: | |
path: source/test-module | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
coverage: xdebug | |
extensions: gd, zip | |
- name: Install module dependencies | |
id: dependencies | |
working-directory: source/test-module | |
run: composer install | |
- name: Run phpcs | |
id: phpcs | |
if: always() | |
working-directory: source/test-module | |
run: composer phpcs | |
- name: Run phpstan | |
id: phpstan | |
if: always() | |
working-directory: source/test-module | |
run: composer phpstan-report || composer phpstan | |
- name: Run phpmd | |
id: phpmd | |
continue-on-error: true | |
if: always() | |
working-directory: source/test-module | |
run: composer phpmd-report || composer phpmd | |
- name: Upload log artifact | |
if: always() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: StylesLog-${{ matrix.php }} | |
path: | | |
source/test-module/phpstan.report.json | |
source/test-module/phpmd.report.json | |
unit_tests: | |
strategy: | |
matrix: | |
php: [ '7.4', '8.0' ] | |
needs: [ install_shop_with_module ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Load current installation from cache | |
uses: actions/cache@v2 | |
with: | |
path: | | |
./* | |
key: shopInstallation-${{ matrix.php }}-${{ github.sha }} | |
restore-keys: | | |
shopInstallation-${{ matrix.php }}-${{ github.sha }} | |
- name: Start containers | |
run: | | |
make up | |
sleep 2 | |
- name: Run tests | |
continue-on-error: true | |
run: | | |
docker-compose run -T --rm \ | |
-e PARTIAL_MODULE_PATHS=oe/graphql-base \ | |
-e ACTIVATE_ALL_MODULES=1 \ | |
-e RUN_TESTS_FOR_SHOP=0 \ | |
-e RUN_TESTS_FOR_MODULES=0 \ | |
-e XDEBUG_MODE=coverage \ | |
-e ADDITIONAL_TEST_PATHS='/var/www/vendor/oxid-esales/graphql-base/tests' \ | |
php php vendor/bin/runtests | |
codeception_tests: | |
strategy: | |
matrix: | |
php: [ '7.4', '8.0' ] | |
needs: [ install_shop_with_module ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Load current installation from cache | |
uses: actions/cache@v2 | |
with: | |
path: | | |
./* | |
key: shopInstallation-${{ matrix.php }}-${{ github.sha }} | |
restore-keys: | | |
shopInstallation-${{ matrix.php }}-${{ github.sha }} | |
- name: Start containers | |
run: | | |
make up | |
sleep 2 | |
- name: Install codeception dependencies | |
run: | | |
docker-compose exec -T php composer require codeception/c3 --dev --no-update | |
docker-compose exec -T php composer require codeception/module-rest:^1.4.2 --dev --no-update | |
docker-compose exec -T php composer require codeception/module-phpbrowser ^1.0.2 --no-update | |
docker-compose exec -T php composer config --no-plugins allow-plugins.codeception/c3 true | |
docker-compose exec -T php composer update | |
sed -i 's/<?php/<?php\n\nrequire(__DIR__ . "\/..\/c3.php");/' source/source/bootstrap.php | |
- name: Run tests | |
continue-on-error: true | |
run: | | |
docker-compose exec -T \ | |
-e PARTIAL_MODULE_PATHS=oe/graphql-base \ | |
-e ACTIVATE_ALL_MODULES=1 \ | |
-e RUN_TESTS_FOR_SHOP=0 \ | |
-e RUN_TESTS_FOR_MODULES=0 \ | |
-e XDEBUG_MODE=coverage \ | |
-e ADDITIONAL_TEST_PATHS='/var/www/vendor/oxid-esales/graphql-base/tests' \ | |
php php vendor/bin/runtests-codeception |