From e7ecbb066b607ba311c4be86d1d1d8f7bf7f73f9 Mon Sep 17 00:00:00 2001 From: orakili Date: Fri, 27 Sep 2024 15:10:38 +0000 Subject: [PATCH] chore: another attempt at running tests Refs: OPS-10828 --- .github/workflows/test.yml | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4c224e9..bbf8653 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Test +name: Module Tests on: [pull_request] env: MYSQL_USER: root @@ -37,10 +37,10 @@ jobs: - name: Get composer cache directory id: composercache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache composer dependencies - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ${{ steps.composercache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} @@ -53,17 +53,14 @@ jobs: - name: Install module dependencies run: | cd modules/custom/ocha_uimc - composer install --no-interaction --no-progress + composer --no-interaction --no-progress --prefer-dist --optimize-autoloader install cd ../../.. - name: Define DRUPAL_ROOT env variable run: | - echo "DRUPAL_ROOT=$HOME/drupal" >> $GITHUB_ENV - - - name: Install drush - run: composer require "drush/drush ^12.0" + echo "DRUPAL_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV - - name: Start MySql service + - name: Start MySQL service run: | sudo /etc/init.d/mysql start @@ -71,21 +68,22 @@ jobs: run: | php -d sendmail_path=$(which true); vendor/bin/drush --yes -v \ site-install minimal --db-url="$SIMPLETEST_DB" - vendor/bin/drush en $DRUPAL_MODULE_NAME -y + vendor/bin/drush en ocha_uimc -y - - name: Run tests + - name: Run module tests run: | vendor/bin/phpunit --bootstrap core/tests/bootstrap.php \ + --configuration modules/custom/ocha_uimc/phpunit.xml \ --coverage-clover ./clover.xml \ - -c modules/custom/ocha_uimc/phpunit.xml modules/custom/ocha_uimc + modules/custom/ocha_uimc - - name: Monitor coverage for Drupal ${{ matrix.drupal-core }} - PHP ${{ matrix.php-versions }} + - name: Monitor coverage id: coveralls uses: slavcodev/coverage-monitor-action@v1 with: github_token: ${{ secrets.GITHUB_TOKEN }} - status_context: Monitor coverage for Drupal ${{ matrix.drupal-core }} - PHP ${{ matrix.php-versions }} - comment_context: Monitor coverage for Drupal ${{ matrix.drupal-core }} - PHP ${{ matrix.php-versions }} + status_context: Coverage (Drupal ${{ matrix.drupal-core }} - PHP ${{ matrix.php-versions }}) + comment_context: Coverage (Drupal ${{ matrix.drupal-core }} - PHP ${{ matrix.php-versions }}) coverage_path: "./clover.xml" threshold_alert: 0 threshold_warning: 50