-
Notifications
You must be signed in to change notification settings - Fork 176
94 lines (93 loc) · 3.32 KB
/
next.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: next
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
phpunit:
runs-on: ubuntu-24.04
strategy:
matrix:
# Supported PHP versions: https://www.drupal.org/docs/getting-started/system-requirements/php-requirements
php:
- "8.1"
- "8.2"
- "8.3"
# Supported Drupal versions: https://www.drupal.org/project/drupal
drupal:
- "10.0.x"
- "10.1.x"
- "10.2.x"
- "10.3.x"
- "11.0.x"
exclude:
- drupal: "10.0.x"
php: "8.3"
- drupal: "10.1.x"
php: "8.3"
- drupal: "11.0.x"
php: "8.1"
- drupal: "11.0.x"
php: "8.2"
name: Drupal ${{ matrix.drupal }} - PHP ${{ matrix.php }}
services:
mysql:
image: mysql:8.0
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@v4
- 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 "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
- uses: actions/cache@v3
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.drupal }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-${{ matrix.drupal }}-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 --no-install
composer install
- name: Run phpcs
run: |
~/drupal/vendor/bin/phpcs -p -s --colors --standard=modules/next/phpcs.xml modules/next
- 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 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