Skip to content

Commit

Permalink
chore: another attempt at running tests
Browse files Browse the repository at this point in the history
Refs: OPS-10828
  • Loading branch information
orakili committed Sep 27, 2024
1 parent 96cb5b0 commit e7ecbb0
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test
name: Module Tests
on: [pull_request]
env:
MYSQL_USER: root
Expand Down Expand Up @@ -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') }}
Expand All @@ -53,39 +53,37 @@ 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
- name: Install Drupal
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
Expand Down

0 comments on commit e7ecbb0

Please sign in to comment.