-
Notifications
You must be signed in to change notification settings - Fork 209
99 lines (88 loc) · 2.7 KB
/
windows-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
name: "Windows Tests"
run-name: "Windows Tests (PHP ${{ inputs.php }} ${{ inputs.arch }} ${{ inputs.ts }})"
on:
workflow_call:
inputs:
php:
description: "The PHP version to build for"
type: string
required: true
arch:
description: "The architecture to build for (x64 or x86)"
type: string
required: true
ts:
description: "Thread safety (ts or nts)"
type: string
required: true
upload_release_asset:
description: "Whether to upload a release asset"
type: boolean
default: false
jobs:
build:
name: "Build Driver"
runs-on: windows-2022
defaults:
run:
shell: cmd
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: "Build Driver"
id: build-driver
uses: ./.github/actions/windows/build
with:
version: ${{ inputs.php }}
arch: ${{ inputs.arch }}
ts: ${{ inputs.ts }}
- name: Cache build artifacts for subsequent builds
id: cache-build-artifacts
uses: actions/cache/save@v4
with:
key: ${{ github.sha }}-${{ inputs.php }}-${{ inputs.ts }}-${{ inputs.arch }}
path: |
${{ steps.build-driver.outputs.build-dir }}\php_mongodb.dll
${{ steps.build-driver.outputs.build-dir }}\php_mongodb.pdb
test:
name: "Run Tests"
runs-on: windows-2022
needs: build
defaults:
run:
shell: cmd
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup MongoDB
id: setup-mongodb
uses: ./tests/drivers-evergreen-tools
with:
version: "7.0"
topology: "server"
- name: Prepare build environment
id: prepare-build
uses: ./.github/actions/windows/prepare-build
with:
version: ${{ inputs.php }}
arch: ${{ inputs.arch }}
ts: ${{ inputs.ts }}
- name: Restore cached build artifacts
id: cache-build-artifacts
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
key: ${{ github.sha }}-${{ inputs.php }}-${{ inputs.ts }}-${{ inputs.arch }}
path: |
${{ steps.prepare-build.outputs.build-dir }}\php_mongodb.dll
${{ steps.prepare-build.outputs.build-dir }}\php_mongodb.pdb
- name: Run Tests
run: nmake /nologo test
env:
NO_INTERACTION: 1
REPORT_EXIT_STATUS: 1
TESTS: --show-diff
MONGODB_URI: ${{ steps.setup-mongodb.outputs.cluster-uri }}
CRYPT_SHARED_LIB_PATH: ${{ steps.setup-mongodb.outputs.crypt-shared-lib-path }}