|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: [push] |
| 4 | + |
| 5 | +env: |
| 6 | + COMPOSER_MEMORY_LIMIT: -1 |
| 7 | + SIMPLETEST_DB: sqlite://tmp/site.sqlite |
| 8 | + SIMPLETEST_BASE_URL: "http://127.0.0.1:8080" |
| 9 | + |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + runs-on: 'ubuntu-20.04' |
| 13 | + strategy: |
| 14 | + fail-fast: false |
| 15 | + matrix: |
| 16 | + php-versions: ['7.3', '7.4', '8.0'] |
| 17 | + drupal-release: ['stable'] |
| 18 | + composer-channel: ['stable'] |
| 19 | + include: |
| 20 | + - php-versions: '8.0' |
| 21 | + drupal-release: dev |
| 22 | + composer-channel: stable |
| 23 | + - php-versions: '8.0' |
| 24 | + drupal-release: stable |
| 25 | + composer-channel: snapshot |
| 26 | + steps: |
| 27 | + - name: Dump matrix context |
| 28 | + env: |
| 29 | + MATRIX_CONTEXT: ${{ toJSON(matrix) }} |
| 30 | + run: echo "$MATRIX_CONTEXT" |
| 31 | + |
| 32 | + - name: Checkout |
| 33 | + uses: actions/checkout@v2 |
| 34 | + |
| 35 | + - name: Setup PHP |
| 36 | + uses: shivammathur/setup-php@v2 |
| 37 | + with: |
| 38 | + php-version: ${{ matrix.php-versions }} |
| 39 | + extensions: gd, pdo_sqlite |
| 40 | + |
| 41 | + - name: Update composer |
| 42 | + run: composer --verbose self-update --${{ matrix.composer-channel }} |
| 43 | + |
| 44 | + - name: Dump composer verson |
| 45 | + run: composer --version |
| 46 | + |
| 47 | + - name: Validate composer.json |
| 48 | + run: composer --verbose validate |
| 49 | + |
| 50 | + - name: Install dependencies |
| 51 | + run: composer --verbose install |
| 52 | + |
| 53 | + - if: matrix.drupal-release == 'dev' |
| 54 | + run: composer --verbose require --no-update drupal/core-recommended:9.2.x-dev && composer --verbose require --no-update --dev drupal/core-dev:9.2.x-dev |
| 55 | + |
| 56 | + - if: matrix.drupal-release == 'dev' |
| 57 | + run: composer --verbose update |
| 58 | + |
| 59 | + - run: ./vendor/bin/drush site-install --verbose --yes --db-url=sqlite://tmp/site.sqlite |
| 60 | + |
| 61 | + - run: ./vendor/bin/drush runserver $SIMPLETEST_BASE_URL & |
| 62 | + |
| 63 | + - run: until curl -s $SIMPLETEST_BASE_URL; do true; done > /dev/null |
| 64 | + |
| 65 | + # https://www.drupal.org/project/drupal/issues/3182653 |
| 66 | + # https://www.drupal.org/node/3176567 |
| 67 | + - if: ${{ matrix.php-versions == '7.4' }} || ${{ matrix.php-versions == '8.0' }} |
| 68 | + run: composer require phpspec/prophecy-phpunit:^2 |
| 69 | + |
| 70 | + - name: Run a single unit test to verfiy the testing setup. |
| 71 | + run: ./vendor/bin/phpunit -c ./web/core ./web/core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php |
| 72 | + |
| 73 | + - run: ./vendor/bin/drush |
0 commit comments