-
Notifications
You must be signed in to change notification settings - Fork 1
161 lines (130 loc) · 4.36 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: Run module tests
on:
pull_request:
schedule:
- cron: '0 6 * * *'
env:
DRUPAL_TESTING_TEST_CODING_STYLES: true
DRUPAL_TESTING_PROJECT_BASEDIR: ${{ github.workspace }}/tests/module
DRUPAL_TESTING_DATABASE_USER: root
DRUPAL_TESTING_DATABASE_PASSWORD: root
DRUPAL_TESTING_DATABASE_ENGINE: mysql
DRUPAL_TESTING_SELENIUM_CHROME_VERSION: '105.0'
jobs:
test-projects:
runs-on: ubuntu-latest
strategy:
matrix:
RUN: [1, 2, 3, 4, 5]
include:
- RUN: 1
DRUPAL_TESTING_DRUPAL_VERSION: '~9.3'
DRUPAL_TESTING_COMPOSER_PROJECT: 'drupal/recommended-project'
PHP_VERSION: '8.1'
- RUN: 2
DRUPAL_TESTING_DRUPAL_VERSION: '~9.3.0'
DRUPAL_TESTING_MIN_BUILD: true
PHP_VERSION: '8.1'
- RUN: 3
DRUPAL_TESTING_COMPOSER_PROJECT: 'thunder/thunder-project'
DRUPAL_TESTING_DRUPAL_VERSION: '~9.4.0'
PHP_VERSION: '7.4'
- RUN: 4
DRUPAL_TESTING_DRUPAL_VERSION: '~9.4'
PHP_VERSION: '8.0'
- RUN: 5
DRUPAL_TESTING_DRUPAL_VERSION: '~10.0'
PHP_VERSION: '8.1'
steps:
- uses: actions/checkout@v1
- uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: ${{ matrix.PHP_VERSION }}
extensions: gd, pdo_mysql
- name: Start MySql service
run: |
sudo /etc/init.d/mysql start
- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache
key: ${{ runner.os }}-composer-cache-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-cache-
- name: Setup environment variables
run: |
echo "$GITHUB_WORKSPACE/vendor/bin" >> $GITHUB_PATH
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
- name: Run tests
run: |
composer install
test-drupal-project --verbose
env:
DRUPAL_TESTING_COMPOSER_PROJECT: ${{ matrix.DRUPAL_TESTING_COMPOSER_PROJECT }}
DRUPAL_TESTING_DRUPAL_VERSION: ${{ matrix.DRUPAL_TESTING_DRUPAL_VERSION }}
DRUPAL_TESTING_MIN_BUILD: ${{ matrix.DRUPAL_TESTING_MIN_BUILD }}
test-split-upload:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: '8.1'
extensions: gd, pdo_mysql
- name: Start MySql service
run: |
sudo /etc/init.d/mysql start
- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache
key: ${{ runner.os }}-composer-cache-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-cache-
- name: Cache NPM dependencies
id: npm-cache
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-npm-cache
restore-keys: ${{ runner.os }}-npm-cache
- name: Setup environment variables
run: |
echo "$GITHUB_WORKSPACE/vendor/bin" >> $GITHUB_PATH
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
- name: Install project
run: |
composer install
test-drupal-project install --verbose
- name: Zip build
run: cd /tmp; tar cfz build.tgz test; mv build.tgz ${GITHUB_WORKSPACE}
- name: Upload build
uses: actions/upload-artifact@v1
with:
name: build
path: build.tgz
test-split-download:
needs: test-split-upload
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: '8.1'
extensions: gd, pdo_mysql
- name: Start MySql service
run: |
sudo /etc/init.d/mysql start
- name: Setup environment variables
run: |
echo "$GITHUB_WORKSPACE/vendor/bin" >> $GITHUB_PATH
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
- name: Download build
uses: actions/download-artifact@v1
with:
name: build
- name: Unzip build artifact
run: tar xCfz /tmp build/build.tgz test; rm -rf build
- name: Run the tests
run: test-drupal-project run_tests --verbose