Skip to content

Commit 0c21082

Browse files
committed
Run tests on a Windows environment in CI
1 parent a5a8635 commit 0c21082

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,23 @@ jobs:
5959
run: "vendor/bin/phpstan analyse --no-progress --error-format=github"
6060

6161
tests:
62-
name: "Tests (PHP ${{ matrix.php-version }})"
63-
runs-on: "ubuntu-latest"
62+
name: "Tests (PHP ${{ matrix.php-version }}, ${{ matrix.os }})"
63+
runs-on: "${{ matrix.os }}"
6464

6565
strategy:
6666
fail-fast: false
6767
matrix:
68+
os:
69+
- "ubuntu-latest"
70+
- "windows-latest"
6871
php-version:
6972
- "8.4"
7073
- "8.5"
7174

75+
defaults:
76+
run:
77+
shell: "bash"
78+
7279
steps:
7380
- uses: "actions/checkout@v7"
7481

@@ -88,7 +95,7 @@ jobs:
8895
run: "vendor/bin/phpunit --configuration phpunit.xml.dist --colors=always"
8996

9097
- name: "Generate coverage summary"
91-
if: ${{ ! cancelled() && matrix.php-version == '8.5' }}
98+
if: ${{ ! cancelled() && matrix.os == 'ubuntu-latest' && matrix.php-version == '8.5' }}
9299
run: |
93100
echo '```' > var/.phpunit.cache/coverage.txt
94101
vendor/bin/phpunit \
@@ -99,18 +106,18 @@ jobs:
99106
100107
- name: "Report test results"
101108
uses: "mikepenz/action-junit-report@v6"
102-
if: ${{ ! cancelled() && matrix.php-version == '8.5' }}
109+
if: ${{ ! cancelled() && matrix.os == 'ubuntu-latest' && matrix.php-version == '8.5' }}
103110
with:
104111
report_paths: "var/.phpunit.cache/junit.xml"
105112
annotate_only: true
106113

107114
- name: "Post coverage summary"
108-
if: ${{ ! cancelled() && matrix.php-version == '8.5' }}
115+
if: ${{ ! cancelled() && matrix.os == 'ubuntu-latest' && matrix.php-version == '8.5' }}
109116
run: 'cat var/.phpunit.cache/coverage.txt >> "$GITHUB_STEP_SUMMARY"'
110117

111118
- name: "Upload coverage report"
112119
uses: "actions/upload-artifact@v7"
113-
if: ${{ ! cancelled() && matrix.php-version == '8.5' }}
120+
if: ${{ ! cancelled() && matrix.os == 'ubuntu-latest' && matrix.php-version == '8.5' }}
114121
with:
115122
name: "coverage-report"
116123
path: |

0 commit comments

Comments
 (0)