-
Notifications
You must be signed in to change notification settings - Fork 28
79 lines (71 loc) · 2.26 KB
/
test.yml
File metadata and controls
79 lines (71 loc) · 2.26 KB
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
on:
workflow_call:
inputs:
name:
description: Name of the driver test
required: true
type: string
driverRepoUrl:
description: Git URL of the driver repository
required: true
type: string
driverRepoBranch:
description: Driver repository branch to check out
required: true
type: string
php:
description: PHP version for running tests
required: true
type: string
setUpCmd:
description: Command to run before test
required: false
type: string
testCmd:
description: Command that runs the test
required: true
type: string
tearDownCmd:
description: Command to run after test
required: false
type: string
jobs:
Test:
runs-on: ubuntu-latest
steps:
- name: Set up workspace for driver repo
# language=bash
run: git clone --single-branch --branch "${{ inputs.driverRepoBranch }}" "${{ inputs.driverRepoUrl }}" .
- uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: ${{ inputs.php }}
- name: Install driver dependencies
# language=bash
run: composer install --no-interaction --ansi --no-progress
- name: Set up driver test suite as composer dependency
# This is instead of `composer require "mink/driver-testsuite:dev-master#${{ github.sha }}"`, which works with forks
uses: actions/checkout@v4
with:
path: ./vendor/mink/driver-testsuite
- name: Set up
# language=bash
run: |
mkdir ./logs
MINK_HOST=0.0.0.0:8002 ./vendor/bin/mink-test-server &> ./logs/mink-test-server.log &
eval "${{ inputs.setUpCmd }}"
curl --retry 5 --retry-all-errors --retry-delay 1 --max-time 10 --head -X GET http://localhost:8002/
- name: Run tests
# language=bash
run: eval "${{ inputs.testCmd }}"
- name: Tear down
if: always()
# language=bash
run: |
eval "${{ inputs.tearDownCmd }}"
- name: Upload logs as artifact
uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ inputs.name }}-logs
path: ./logs