diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bbf8653..4753355 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Module Tests +name: Test on: [pull_request] env: MYSQL_USER: root @@ -46,21 +46,19 @@ jobs: key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- - - name: Install Drupal core dependencies + - name: Install Drupal core and module dependencies run: | - composer --no-interaction --no-progress --prefer-dist --optimize-autoloader install - - - name: Install module dependencies - run: | - cd modules/custom/ocha_uimc - composer --no-interaction --no-progress --prefer-dist --optimize-autoloader install - cd ../../.. + composer config repositories.module '{"type": "path", "url": "modules/custom/ocha_uimc", "options": {"symlink": false}}' + composer require unocha/ocha_uimc:@dev --no-interaction --no-progress --prefer-dist --optimize-autoloader - name: Define DRUPAL_ROOT env variable run: | echo "DRUPAL_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV - - name: Start MySQL service + - name: Install drush + run: composer require "drush/drush ^12.0" + + - name: Start MySql service run: | sudo /etc/init.d/mysql start @@ -73,17 +71,16 @@ jobs: - name: Run module tests run: | vendor/bin/phpunit --bootstrap core/tests/bootstrap.php \ - --configuration modules/custom/ocha_uimc/phpunit.xml \ --coverage-clover ./clover.xml \ - modules/custom/ocha_uimc + -c modules/custom/ocha_uimc/phpunit.xml modules/custom/ocha_uimc - name: Monitor coverage id: coveralls uses: slavcodev/coverage-monitor-action@v1 with: github_token: ${{ secrets.GITHUB_TOKEN }} - status_context: Coverage (Drupal ${{ matrix.drupal-core }} - PHP ${{ matrix.php-versions }}) - comment_context: Coverage (Drupal ${{ matrix.drupal-core }} - PHP ${{ matrix.php-versions }}) + 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 }} coverage_path: "./clover.xml" threshold_alert: 0 threshold_warning: 50