build: fix commitlint integration and add semantic commit message doc… #1000
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: next | |
on: | |
push: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
phpunit: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php: ["8.0", "8.1"] | |
drupal: ["9.4", "9.5", "10.0"] | |
exclude: | |
- php: "8.0" | |
drupal: "10.0" | |
name: Drupal ${{ matrix.drupal }} - PHP ${{ matrix.php }} | |
services: | |
mysql: | |
image: mysql:5.7 | |
env: | |
MYSQL_ALLOW_EMPTY_PASSWORD: yes | |
MYSQL_DATABASE: db | |
ports: | |
- 3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: dom, curl, libxml, mbstring, zip, pdo, mysql, pdo_mysql, bcmath, soap, intl, gd, exif, iconv | |
coverage: none | |
tools: composer:v2 | |
- name: Get composer cache directory | |
id: composercache | |
run: | | |
cd modules/next | |
echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- uses: actions/cache@v2 | |
with: | |
path: ${{ steps.composercache.outputs.dir }} | |
key: ${{ runner.os }}-${{ matrix.drupal }}-composer-${{ hashFiles('**/composer.json') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Setup problem matchers for PHPUnit | |
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
- name: Setup Drupal | |
run: | | |
COMPOSER_MEMORY_LIMIT=-1 composer create-project drupal/recommended-project:${{ matrix.drupal }} ~/drupal --no-interaction --no-install | |
cd ~/drupal | |
composer config extra.enable-patching true | |
composer config extra.compile-mode all | |
composer config minimum-stability dev | |
composer config prefer-stable true | |
composer config preferred-install dist | |
composer config repositories.0 path $GITHUB_WORKSPACE | |
composer config repositories.1 composer https://packages.drupal.org/8 | |
composer config allow-plugins true -n | |
COMPOSER_MEMORY_LIMIT=-1 composer require drupal/core-dev:${{ matrix.drupal }} --no-suggest --no-install | |
composer install | |
- name: Add phpspec/prophecy-phpunit | |
run: | | |
cd ~/drupal | |
COMPOSER_MEMORY_LIMIT=-1 composer require --dev phpspec/prophecy-phpunit:^2 -W | |
if: ${{ startsWith(matrix.drupal, '9') }} | |
- name: Copy module | |
run: cp -R ../next-drupal/modules/next ~/drupal/web/modules/next | |
- name: Run php built-in server | |
run: php -S 127.0.0.1:8080 -t ~/drupal/web & | |
- name: Run phpcs | |
run: | | |
cd ~/drupal/web | |
cp modules/next/phpcs.xml.dist . | |
../vendor/bin/phpcs --standard=./phpcs.xml.dist modules/next -p -s -n --colors | |
- name: Run PHPUnit | |
run: | | |
cd ~/drupal/web | |
../vendor/bin/phpunit -c core modules/next | |
env: | |
SYMFONY_DEPRECATIONS_HELPER: weak | |
SIMPLETEST_DB: mysql://root:@127.0.0.1:${{ job.services.mysql.ports[3306] }}/db | |
SIMPLETEST_BASE_URL: http://127.0.0.1:8080 |