Skip to content

Commit db3a290

Browse files
committed
Install chromedriver on host since GitHub services can't access host ports
1 parent 6d14ca1 commit db3a290

File tree

1 file changed

+30
-32
lines changed

1 file changed

+30
-32
lines changed

.github/workflows/build-2.x.yml

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,35 @@
1-
# This is a basic workflow to help you get started with Actions
2-
31
name: CI
42

5-
# Controls when the action will run.
63
on:
7-
# Triggers the workflow on push or pull request events but only for the 2.x branch
84
push:
95
branches: [ 2.x ]
106
pull_request:
117
branches: [ 2.x ]
12-
13-
# Allows you to run this workflow manually from the Actions tab
148
workflow_dispatch:
159

16-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1710
jobs:
18-
# This workflow contains a single job called "build"
1911
build:
20-
# The type of runner that the job will run on
12+
env:
13+
DRUPAL_VERSION: ${{ matrix.drupal-version }}
14+
SCRIPT_DIR: ${{ github.workspace }}/islandora_ci
15+
DRUPAL_DIR: /opt/drupal
16+
PHPUNIT_FILE: ${{ github.workspace }}/build_dir/phpunit.xml
17+
MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", {"browserName":"chrome","chromeOptions":{"args":["--disable-gpu","--headless", "--no-sandbox", "--disable-dev-shm-usage"]}}, "http://localhost:9515"]'
18+
CHROMEDRIVER_VERSION: 114.0.5735.90
19+
2120
runs-on: ubuntu-latest
2221
continue-on-error: ${{ matrix.allowed_failure }}
2322
strategy:
2423
fail-fast: false
2524
matrix:
26-
php-versions: ["8.1", "8.2"]
27-
# test-suite functional-javascript will appear to pass but will skip tests; missing chromedriver.
25+
php-versions: ["8.1", "8.2", "8.3"]
2826
test-suite: ["kernel", "functional", "functional-javascript"]
29-
drupal-version: ["10.0.x", "10.1.x", "10.2.x-dev"]
27+
drupal-version: ["10.1.x", "10.2.x", "10.3.x-dev"]
3028
mysql: ["8.0"]
3129
allowed_failure: [false]
30+
exclude:
31+
- php-versions: "8.3"
32+
drupal-version: "10.1.x"
3233

3334

3435
name: PHP ${{ matrix.php-versions }} | drupal ${{ matrix.drupal-version }} | mysql ${{ matrix.mysql }} | test-suite ${{ matrix.test-suite }}
@@ -47,24 +48,16 @@ jobs:
4748
- 8161:8161
4849
- 61616:61616
4950
- 61613:61613
50-
chrome:
51-
image: drupalci/webdriver-chromedriver:production
52-
ports:
53-
- 9515:9515
54-
# XXX: Doesn't presently work; however, seems to represent the current default.
55-
#options: --entrypoint 'chromedriver --log-path=/tmp/chromedriver.log --verbose --allowed-ips= --allowed-origins=*'
5651

57-
# Steps represent a sequence of tasks that will be executed as part of the job
5852
steps:
5953

60-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
6154
- name: Checkout code
62-
uses: actions/checkout@v3
55+
uses: actions/checkout@v4
6356
with:
6457
path: build_dir
6558

6659
- name: Checkout islandora_ci
67-
uses: actions/checkout@v3
60+
uses: actions/checkout@v4
6861
with:
6962
repository: islandora/islandora_ci
7063
ref: github-actions
@@ -82,13 +75,6 @@ jobs:
8275
sudo apt-get remove -y mysql-client mysql-common
8376
sudo apt-get install -y mysql-client
8477
85-
- name: Set environment variables
86-
run: |
87-
echo "DRUPAL_VERSION=${{ matrix.drupal-version }}" >> $GITHUB_ENV
88-
echo "SCRIPT_DIR=$GITHUB_WORKSPACE/islandora_ci" >> $GITHUB_ENV
89-
echo "DRUPAL_DIR=/opt/drupal" >> $GITHUB_ENV
90-
echo "PHPUNIT_FILE=$GITHUB_WORKSPACE/build_dir/phpunit.xml" >> $GITHUB_ENV
91-
9278
- name: Cache Composer dependencies
9379
uses: actions/cache@v3
9480
with:
@@ -121,11 +107,23 @@ jobs:
121107

122108
- name: Test scripts
123109
run: $SCRIPT_DIR/travis_scripts.sh
110+
111+
- name: Start chromedriver
112+
if: matrix.test-suite == 'functional-javascript'
113+
run: |-
114+
curl -s -o ./chromedriver_linux64.zip https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip
115+
unzip chromedriver_linux64.zip
116+
./chromedriver \
117+
--log-path=/tmp/chromedriver.log \
118+
--verbose \
119+
--allowed-ips= \
120+
--allowed-origins=*" &
124121
125122
- name: PHPUNIT tests
126-
env:
127-
MINK_DRIVER_ARGS: '["chrome", {"browserName":"chrome","chromeOptions":{"args":["--disable-gpu","--headless", "--no-sandbox", "--disable-dev-shm-usage"]}}, "http://chrome:9515"]'
128-
MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", {"browserName":"chrome","chromeOptions":{"args":["--disable-gpu","--headless", "--no-sandbox", "--disable-dev-shm-usage"]}}, "http://chrome:9515"]'
129123
run: |
130124
cd $DRUPAL_DIR/web/core
131125
$DRUPAL_DIR/vendor/bin/phpunit --verbose --testsuite "${{ matrix.test-suite }}"
126+
127+
- name: Print chromedriver logs
128+
if: matrix.test-suite == 'functional-javascript'
129+
run: cat /tmp/chromedriver.log

0 commit comments

Comments
 (0)