[#653] Added Composer normalizer check to CI. #80
Workflow file for this run
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: CI | |
on: | |
push: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
env: | |
COMPOSER_MEMORY_LIMIT: -1 | |
SIMPLETEST_DB: sqlite://tmp/site.sqlite | |
SIMPLETEST_BASE_URL: "http://127.0.0.1:8080" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
php-versions: ['8.3'] | |
drupal-release: ['alpha', 'dev'] | |
composer-channel: ['stable', 'snapshot'] | |
steps: | |
- name: Dump matrix context | |
env: | |
MATRIX_CONTEXT: ${{ toJSON(matrix) }} | |
run: echo "$MATRIX_CONTEXT" | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Upgrade sqlite3 | |
run: | | |
wget https://www.sqlite.org/2024/sqlite-autoconf-3450300.tar.gz -O /tmp/sqlite.tar.gz | |
tar -xzf /tmp/sqlite.tar.gz -C /tmp | |
cd /tmp/sqlite-autoconf-3450300 | |
./configure CFLAGS="-DSQLITE_ENABLE_COLUMN_METADATA=1" --prefix=/usr/local | |
make && sudo make install | |
sudo ldconfig | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
extensions: gd, sqlite, pdo_sqlite | |
- name: Update Composer | |
run: composer --verbose self-update --${{ matrix.composer-channel }} | |
- name: Show Composer version | |
run: composer --version | |
- name: Validate composer.json | |
run: composer --verbose validate | |
- name: Install dependencies | |
run: composer --verbose install | |
- name: Validate composer.json structure | |
run: composer normalize --dry-run | |
- name: Override Drupal version to dev for testing dev releases | |
if: matrix.drupal-release == 'dev' | |
run: | | |
composer --verbose require --no-update drupal/core-recommended:11.0.x-dev | |
composer --verbose require --no-update --dev drupal/core-dev:11.0.x-dev | |
composer --verbose update | |
- name: Install site | |
run: ./vendor/bin/drush site-install --verbose --yes --db-url=sqlite://tmp/site.sqlite | |
- name: Start server | |
run: | | |
./vendor/bin/drush runserver "$SIMPLETEST_BASE_URL" & | |
until curl -s "$SIMPLETEST_BASE_URL"; do true; done > /dev/null | |
- name: Run a single unit test to verify the testing setup | |
run: ./vendor/bin/phpunit -c ./web/core $(pwd)/web/core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php |