1
1
name : " Windows Tests"
2
+ run-name : " Windows Tests (PHP ${{ inputs.php }} ${{ inputs.arch }} ${{ inputs.ts }})"
2
3
3
4
on :
4
- pull_request :
5
- branches :
6
- - " v*.*"
7
- - " master"
8
- - " feature/*"
9
- push :
10
- branches :
11
- - " v*.*"
12
- - " master"
13
- - " feature/*"
5
+ workflow_call :
6
+ inputs :
7
+ php :
8
+ description : " The PHP version to build for"
9
+ type : string
10
+ required : true
11
+ arch :
12
+ description : " The architecture to build for (x64 or x86)"
13
+ type : string
14
+ required : true
15
+ ts :
16
+ description : " Thread safety (ts or nts)"
17
+ type : string
18
+ required : true
19
+ upload_release_asset :
20
+ description : " Whether to upload a release asset"
21
+ type : boolean
22
+ default : false
14
23
15
24
jobs :
16
25
build :
17
- name : " Build Windows DLLs "
26
+ name : " Build Driver "
18
27
runs-on : windows-2022
19
28
defaults :
20
29
run :
21
30
shell : cmd
22
31
23
- strategy :
24
- # This matrix intentionally uses fail-fast: false to ensure other builds are finished
25
- fail-fast : false
26
- matrix :
27
- php : [ "7.4", "8.0", "8.1", "8.2", "8.3" ]
28
- arch : [ x64, x86 ]
29
- ts : [ ts, nts ]
30
-
31
32
steps :
32
33
- uses : actions/checkout@v4
33
34
with :
@@ -37,36 +38,27 @@ jobs:
37
38
id : build-driver
38
39
uses : ./.github/actions/windows/build
39
40
with :
40
- version : ${{ matrix .php }}
41
- arch : ${{ matrix .arch }}
42
- ts : ${{ matrix .ts }}
41
+ version : ${{ inputs .php }}
42
+ arch : ${{ inputs .arch }}
43
+ ts : ${{ inputs .ts }}
43
44
44
45
- name : Cache build artifacts for subsequent builds
45
46
id : cache-build-artifacts
46
47
uses : actions/cache/save@v4
47
48
with :
48
- key : ${{ github.sha }}-${{ matrix .php }}-${{ matrix .ts }}-${{ matrix .arch }}
49
+ key : ${{ github.sha }}-${{ inputs .php }}-${{ inputs .ts }}-${{ inputs .arch }}
49
50
path : |
50
51
${{ steps.build-driver.outputs.build-dir }}\php_mongodb.dll
51
52
${{ steps.build-driver.outputs.build-dir }}\php_mongodb.pdb
52
53
53
54
test :
54
- name : " Windows Tests"
55
+ name : " Run Tests"
55
56
runs-on : windows-2022
56
57
needs : build
57
58
defaults :
58
59
run :
59
60
shell : cmd
60
61
61
- strategy :
62
- # Timeouts starting the MongoDB service are common and should not
63
- # interrupt the overall test matrix.
64
- fail-fast : false
65
- matrix :
66
- php : [ "7.4", "8.0", "8.1", "8.2", "8.3" ]
67
- arch : [ x64, x86 ]
68
- ts : [ ts, nts ]
69
-
70
62
steps :
71
63
- uses : actions/checkout@v4
72
64
with :
@@ -82,16 +74,16 @@ jobs:
82
74
id : prepare-build
83
75
uses : ./.github/actions/windows/prepare-build
84
76
with :
85
- version : ${{ matrix .php }}
86
- arch : ${{ matrix .arch }}
87
- ts : ${{ matrix .ts }}
77
+ version : ${{ inputs .php }}
78
+ arch : ${{ inputs .arch }}
79
+ ts : ${{ inputs .ts }}
88
80
89
81
- name : Restore cached build artifacts
90
82
id : cache-build-artifacts
91
83
uses : actions/cache/restore@v4
92
84
with :
93
85
fail-on-cache-miss : true
94
- key : ${{ github.sha }}-${{ matrix .php }}-${{ matrix .ts }}-${{ matrix .arch }}
86
+ key : ${{ github.sha }}-${{ inputs .php }}-${{ inputs .ts }}-${{ inputs .arch }}
95
87
path : |
96
88
${{ steps.prepare-build.outputs.build-dir }}\php_mongodb.dll
97
89
${{ steps.prepare-build.outputs.build-dir }}\php_mongodb.pdb
0 commit comments