From c73c7a5f01aad5b602679e2d775305ed69b4095b Mon Sep 17 00:00:00 2001 From: tuutti Date: Sat, 25 Mar 2023 08:27:15 +0200 Subject: [PATCH] UHF-6859: Use drupal-helfi-platform to run tests --- .github/workflows/ci.yml | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4928306b..fd08144c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,6 @@ name: CI env: SIMPLETEST_DB: "mysql://drupal:drupal@db:3306/drupal" SIMPLETEST_BASE_URL: "http://127.0.0.1:8888" - DRUPAL_CORE_VERSION: 9.5.x SYMFONY_DEPRECATIONS_HELPER: disabled BROWSERTEST_OUTPUT_DIRECTORY: 'sites/simpletest' jobs: @@ -15,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-versions: ['8.0', '8.1'] + php-versions: ['8.1'] container: image: ghcr.io/city-of-helsinki/drupal-php-docker:${{ matrix.php-versions }}-alpine @@ -42,47 +41,40 @@ jobs: run: echo "DRUPAL_ROOT=$HOME/drupal" >> $GITHUB_ENV - name: Set module folder - run: echo "MODULE_FOLDER=$DRUPAL_ROOT/modules/contrib/$MODULE_NAME" >> $GITHUB_ENV + run: echo "MODULE_FOLDER=$DRUPAL_ROOT/public/modules/contrib/$MODULE_NAME" >> $GITHUB_ENV - - name: Clone drupal - run: git clone --depth 1 --branch "$DRUPAL_CORE_VERSION" http://git.drupal.org/project/drupal.git/ $DRUPAL_ROOT + - name: Clone platform + run: git clone https://github.com/City-of-Helsinki/drupal-helfi-platform.git $DRUPAL_ROOT - name: Install required composer dependencies + working-directory: ${{ env.DRUPAL_ROOT }} run: | - cd $DRUPAL_ROOT - composer config platform.php ${{ matrix.php-versions }} - composer config repositories.4 composer https://repository.drupal.hel.ninja/ composer config repositories.5 path $GITHUB_WORKSPACE composer require drupal/$MODULE_NAME -W - composer run-script drupal-phpunit-upgrade - composer require "drush/drush ^11.0" - composer config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true - composer require --dev donatj/mock-webserver - composer require --dev "drupal/coder" - name: Install Drupal + working-directory: ${{ env.DRUPAL_ROOT }} run: | - cd $DRUPAL_ROOT php -d sendmail_path=$(which true); vendor/bin/drush --yes -v site-install minimal --db-url="$SIMPLETEST_DB" vendor/bin/drush en $MODULE_NAME -y - name: Run PHPCS + working-directory: ${{ env.DRUPAL_ROOT }} run: | - cd $DRUPAL_ROOT vendor/bin/phpcs $MODULE_FOLDER --standard=Drupal --extensions=php,module,inc,install,test,info - name: Start services + working-directory: ${{ env.DRUPAL_ROOT }} run: | - cd $DRUPAL_ROOT vendor/bin/drush runserver $SIMPLETEST_BASE_URL > /dev/null 2>&1 & chromedriver --port=4444 > /dev/null 2>&1 & - name: Run PHPUnit tests + working-directory: ${{ env.DRUPAL_ROOT }} run: | - cd $DRUPAL_ROOT php -d pcov.directory=$MODULE_FOLDER \ vendor/bin/phpunit \ - --bootstrap $DRUPAL_ROOT/core/tests/bootstrap.php \ + --bootstrap $DRUPAL_ROOT/public/core/tests/bootstrap.php \ -c $MODULE_FOLDER/phpunit.xml \ --coverage-clover=coverage.xml \ $MODULE_FOLDER