|
| 1 | +name: Drupal test routine |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - 'main' |
| 7 | + - 'dev' |
| 8 | + - 'test/dev' |
| 9 | + pull_request: |
| 10 | + branches: |
| 11 | + - 'main' |
| 12 | + |
| 13 | +jobs: |
| 14 | + composer-test-suite: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + steps: |
| 17 | + - name: Checkout |
| 18 | + uses: actions/checkout@v4 |
| 19 | + - name: Composer install |
| 20 | + run: | |
| 21 | + composer install -n --prefer-dist |
| 22 | + composer validate |
| 23 | + - name: phpcs checks |
| 24 | + run: | |
| 25 | + ./vendor/bin/phpcs |
| 26 | +
|
| 27 | + drupal-test-suite: |
| 28 | + runs-on: ubuntu-latest |
| 29 | + steps: |
| 30 | + - name: Create full set of envvars |
| 31 | + uses: FranzDiebold/github-env-vars-action@v2 |
| 32 | + - name: Checkout |
| 33 | + uses: actions/checkout@v4 |
| 34 | + with: |
| 35 | + repository: lagoon-examples/drupal-base |
| 36 | + path: drupal-base |
| 37 | + ref: main |
| 38 | + - name: Report versions |
| 39 | + run: | |
| 40 | + docker version |
| 41 | + docker compose version |
| 42 | + node -v |
| 43 | + yarn -v |
| 44 | + - name: Add drupal-integrations override |
| 45 | + working-directory: drupal-base |
| 46 | + run: | |
| 47 | + composer config repositories.amazeeio/drupal_integrations '{"type": "github", "url": "http://github.com/amazeeio/drupal-integrations"}' |
| 48 | + composer config github-oauth.github.com ${{ secrets.GITHUB_TOKEN }} |
| 49 | + composer config platform.php 8.3.1 |
| 50 | + composer require --no-install amazeeio/drupal_integrations:dev-${{ env.CI_ACTION_REF_NAME }} |
| 51 | + - name: Pull all images |
| 52 | + working-directory: drupal-base |
| 53 | + run: | |
| 54 | + docker compose pull --ignore-pull-failures |
| 55 | + - name: Install test harness |
| 56 | + working-directory: drupal-base |
| 57 | + run: | |
| 58 | + yarn add leia-parser mocha chai@4 command-line-test |
| 59 | + - name: Generate test files |
| 60 | + working-directory: drupal-base |
| 61 | + run: | |
| 62 | + yarn leia "TESTING*.md" test -r 2 -s 'Start up tests' -t 'Verification commands' -c 'Destroy tests' --split-file |
| 63 | + - name: Run docker compose tests |
| 64 | + working-directory: drupal-base |
| 65 | + env: |
| 66 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 67 | + run: | |
| 68 | + yarn mocha --timeout 900000 test/*compose*.func.js |
0 commit comments