2020-05-13 02:23:12 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
2020-05-15 11:19:54 +00:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
pull_request:
|
2020-05-13 02:23:12 +00:00
|
|
|
|
|
|
|
jobs:
|
2020-06-26 11:29:59 +00:00
|
|
|
install:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
name: Test site installation
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Cache dependencies
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~/.composer/cache/files
|
|
|
|
key: dependencies-composer-${{ hashFiles('composer.json') }}
|
|
|
|
|
|
|
|
- name: Setup PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
php-version: 7.4
|
|
|
|
extensions: mbstring
|
|
|
|
coverage: none
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: composer install --prefer-dist --no-interaction --no-suggest
|
|
|
|
|
|
|
|
- name: Install Drupal
|
|
|
|
run: >
|
|
|
|
vendor/bin/drush --root=$(pwd)/web
|
|
|
|
site:install -y
|
|
|
|
--existing-config
|
|
|
|
--db-url=sqlite://sites/default/files/.ht.sqlite
|
|
|
|
|
|
|
|
- name: Start a web server
|
|
|
|
run: php -S localhost:8000 -t web 2>&1 &
|
|
|
|
|
|
|
|
- name: Test loading the home page
|
|
|
|
run: curl http://localhost:8000
|
|
|
|
|
|
|
|
- name: Verify the home page has the site name in it
|
|
|
|
run: curl -s http://localhost:8000 | grep "Oliver Davies"
|
|
|
|
|
2020-05-13 02:23:12 +00:00
|
|
|
tests:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
name: "Run ${{ matrix.test-types }} tests"
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
test-types:
|
|
|
|
- functional
|
|
|
|
- kernel
|
|
|
|
- unit
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Cache dependencies
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~/.composer/cache/files
|
|
|
|
key: dependencies-composer-${{ hashFiles('composer.json') }}
|
|
|
|
|
|
|
|
- name: Setup PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
php-version: 7.4
|
|
|
|
extensions: mbstring
|
|
|
|
coverage: none
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: composer install --prefer-dist --no-interaction --no-suggest
|
|
|
|
|
|
|
|
- name: Start the local web server
|
2020-05-15 11:17:58 +00:00
|
|
|
run: php -S localhost:8000 -t web 2>&1 &
|
2020-05-13 02:23:12 +00:00
|
|
|
if: matrix.test-types == 'functional'
|
|
|
|
|
|
|
|
- name: Execute tests
|
2020-05-13 16:40:35 +00:00
|
|
|
run: vendor/bin/phpunit --testdox --colors=always --testsuite=${{ matrix.test-types }}
|
2020-05-13 02:23:12 +00:00
|
|
|
env:
|
|
|
|
SIMPLETEST_BASE_URL: http://localhost:8000
|