-
Notifications
You must be signed in to change notification settings - Fork 13
110 lines (93 loc) · 3.68 KB
/
tests.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Swagger UI Formatter tests
on:
workflow_dispatch:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
code_style:
runs-on: ubuntu-20.04
steps:
- name: Checkout Swagger UI Formatter
uses: actions/checkout@v2
- name: Checkout Drupal-Dev
uses: actions/checkout@v2
with:
repository: Pronovix/docker-drupal-dev
path: ./drupal-dev
- name: Setup environment
run: |
mkdir build
sudo chown runneradmin build
ln -s drupal-dev/docker-compose.yml .
ln -s drupal-dev/Dockerfile .
printf "COMPOSE_PROJECT_NAME=swagger_ui_formatter\n" > .env
- name: Create Docker containers
env:
PHP_IMAGE: "wodby/drupal-php:8.1-dev"
run: |
docker compose pull --quiet
docker compose up -d --build
- name: Install dependencies
run: |
chmod a+rw .
docker compose exec -T php composer install --no-interaction --no-suggest --no-progress -d ..
- name: Run code style check
run: CHECK_CS="true" ./.dev/.ci/check-cs.sh
test:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
php_image: ["wodby/drupal-php:8.1-dev", "wodby/drupal-php:8.2-dev"]
db_image: ["wodby/mariadb:10.5"]
# TODO Get version range from composer.json dynamically.
drupal_version: ["^10.1"]
lowest_highest: ["--prefer-lowest", ""]
steps:
- name: Checkout Swagger UI Formatter
uses: actions/checkout@v2
- name: Checkout Drupal-Dev
uses: actions/checkout@v2
with:
repository: Pronovix/docker-drupal-dev
path: ./drupal-dev
# TODO Remove this after Drupal QA got a PHP 8.2 compatible release.
- name: Drupal QA workaround
if: matrix.php_image == 'wodby/drupal-php:8.2-dev'
run: |
export COMPOSER_IGNORE_PLATFORM_REQ=php+
- name: Setup environment
run: |
mkdir build
sudo chown runneradmin build
ln -s drupal-dev/docker-compose.yml .
ln -s drupal-dev/Dockerfile .
printf "COMPOSE_PROJECT_NAME=swagger_ui_formatter\n" > .env
- name: Create Docker containers
env:
PHP_IMAGE: ${{ matrix.php_image }}
DB_IMAGE: ${{ matrix.db_image }}
run: |
docker compose pull --quiet
docker compose up -d --build
- name: Install dependencies
run: |
chmod a+rw .
docker compose exec -T php composer install --no-interaction --no-suggest --no-progress -d ..
chmod a+rw composer.json
docker compose exec -T php composer require drupal/core:${{ matrix.drupal_version }} drupal/core-dev:${{ matrix.drupal_version }} drupal/core-recommended:${{ matrix.drupal_version }} drupal/core-composer-scaffold:${{ matrix.drupal_version }} --no-update -d ..
docker compose exec --env COMPOSER_DISCARD_CHANGES=true -T php composer update --no-progress ${{ matrix.lowest_highest }} -d ..
- name: List installed dependencies
run: docker compose exec -T php composer show -d ..
- name: Set up Drupal settings files
run: |
sudo chown -R runner build/web/sites
ln -s ../../../../drupal-dev/drupal/settings.php build/web/sites/default/settings.php
ln -s ../../../../drupal-dev/drupal/settings.shared.php build/web/sites/default/settings.shared.php
ln -s ../../../../drupal-dev/drupal/settings.testing.php build/web/sites/default/settings.testing.php
ln -s ../../../drupal-dev/drupal/development.services.yml.dist build/web/sites/development.services.yml.dist
sudo chown -R runneradmin build/web/sites
- name: Run tests
run: RUN_PHPUNIT_TESTS="true" ./.dev/.ci/run-phpunit-tests.sh