Skip to content

Commit 8779ff0

Browse files
committed
Run test suite on windows
1 parent 615e21f commit 8779ff0

File tree

1 file changed

+88
-0
lines changed

1 file changed

+88
-0
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Windows doesn't support Docker out-of-box so we can run mostly unit test
2+
name: Test Suite on Windows
3+
4+
on:
5+
pull_request:
6+
paths:
7+
- '.github/workflows/**'
8+
- 'src/adapter/**'
9+
- 'src/core/**'
10+
- 'src/lib/**'
11+
- 'tools/**'
12+
- 'examples/**'
13+
- 'composer.lock'
14+
push:
15+
branches: [ 1.x ]
16+
paths-ignore:
17+
- 'CHANGELOG.md'
18+
19+
# See https://stackoverflow.com/a/72408109
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
22+
cancel-in-progress: true
23+
24+
jobs:
25+
tests:
26+
name: "Tests"
27+
28+
runs-on: "windows-latest"
29+
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
dependencies:
34+
- "locked"
35+
- "lowest"
36+
- "highest"
37+
php-version:
38+
- "8.1"
39+
- "8.2"
40+
- "8.3"
41+
- "8.4"
42+
43+
steps:
44+
- name: "Checkout"
45+
uses: "actions/checkout@v4"
46+
47+
- name: "Install PHP"
48+
uses: "shivammathur/setup-php@v2"
49+
with:
50+
tools: composer:v2
51+
php-version: "${{ matrix.php-version }}"
52+
ini-values: memory_limit=-1
53+
extensions: :psr, bcmath, dom, hash, json, mbstring, xml, xmlwriter, xmlreader, zlib, sodium
54+
55+
- name: "List PHP Extensions"
56+
run: php -m
57+
58+
- name: "List PHP configuration"
59+
run: php -i
60+
61+
- name: "Get Composer Cache Directory"
62+
id: composer-cache
63+
run: |
64+
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
65+
66+
- name: "Cache Composer dependencies"
67+
uses: "actions/cache@v4"
68+
with:
69+
path: "~\\AppData\\Roaming\\composer"
70+
key: "${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**\\composer.lock') }}"
71+
restore-keys: |
72+
${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-
73+
74+
- name: "Install lowest dependencies"
75+
if: ${{ matrix.dependencies == 'lowest' }}
76+
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"
77+
78+
- name: "Install highest dependencies"
79+
if: ${{ matrix.dependencies == 'highest' }}
80+
run: "composer update --no-interaction --no-progress --no-suggest"
81+
82+
- name: "Install locked dependencies"
83+
if: ${{ matrix.dependencies == 'locked' }}
84+
run: "composer install --no-interaction --no-progress --no-suggest"
85+
86+
# Please see note at top why only running unit tests
87+
- name: "Test"
88+
run: "composer test -- --testsuite unit"

0 commit comments

Comments
 (0)