[OPS-10828] Rename module to ocha_entraid and add login form and group management #4
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: Run tests | |
on: [pull_request] | |
env: | |
MYSQL_USER: root | |
MYSQL_PASSWORD: root | |
MYSQL_DATABASE: drupal | |
MYSQL_ROOT_PASSWORD: root | |
SIMPLETEST_DB: "mysql://root:root@localhost:3306/drupal" | |
SIMPLETEST_BASE_URL: "http://127.0.0.1:8080" | |
jobs: | |
testing: | |
name: Drupal ${{ matrix.drupal-core }} - PHP ${{ matrix.php-versions }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
drupal-core: ['10.3.x'] | |
php-versions: ['8.3'] | |
steps: | |
- name: Checkout Drupal core | |
uses: actions/checkout@v4 | |
with: | |
repository: drupal/drupal | |
ref: ${{ matrix.drupal-core }} | |
- name: Checkout module | |
uses: actions/checkout@v4 | |
with: | |
path: modules/contrib/ocha_entraid | |
- name: Setup PHP, with composer and extensions | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
coverage: xdebug | |
- name: Get composer cache directory | |
id: composercache | |
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Cache composer dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.composercache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Remove platform PHP config | |
run: composer config --unset platform.php | |
- name: Install Drupal core and module dependencies | |
run: | | |
composer config repositories.module '{"type": "path", "url": "modules/contrib/ocha_entraid", "options": {"symlink": false}}' | |
composer require unocha/ocha_entraid:@dev --no-interaction --no-progress --prefer-dist --optimize-autoloader | |
- name: Define DRUPAL_ROOT env variable | |
run: | | |
echo "DRUPAL_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV | |
- name: Install drush | |
run: composer require "drush/drush ^12.0" | |
- 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 ocha_entraid -y | |
- name: Run module tests | |
run: | | |
XDEBUG_MODE=coverage php -d zend_extension=xdebug ./vendor/bin/phpunit --bootstrap core/tests/bootstrap.php \ | |
--coverage-clover ./clover.xml \ | |
-c modules/contrib/ocha_entraid/phpunit.xml modules/contrib/ocha_entraid | |
- 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 }} | |
coverage_path: "./clover.xml" | |
threshold_alert: 0 | |
threshold_warning: 50 | |
threshold_metric: "lines" | |
comment_footer: false |