Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions .github/workflows/test-suite-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Windows doesn't support Docker out-of-box so we can run mostly unit test
name: Test Suite on Windows

on:
pull_request:
paths:
- '.github/workflows/**'
- 'src/adapter/**'
- 'src/core/**'
- 'src/lib/**'
- 'tools/**'
- 'examples/**'
- 'composer.lock'
push:
branches: [ 1.x ]
paths-ignore:
- 'CHANGELOG.md'

# See https://stackoverflow.com/a/72408109
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
tests:
name: "Tests"

runs-on: "windows-latest"

strategy:
fail-fast: false
matrix:
dependencies:
- "locked"
- "lowest"
- "highest"
php-version:
- "8.1"
- "8.2"
- "8.3"
- "8.4"

steps:
- name: "Checkout"
uses: "actions/checkout@v4"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
tools: composer:v2
php-version: "${{ matrix.php-version }}"
ini-values: memory_limit=-1
extensions: :psr, bcmath, dom, hash, json, mbstring, xml, xmlwriter, xmlreader, zlib, sodium

- name: "List PHP Extensions"
run: php -m

- name: "List PHP configuration"
run: php -i

- name: "Get Composer Cache Directory"
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: "Cache Composer dependencies"
uses: "actions/cache@v4"
with:
path: "~\\AppData\\Roaming\\composer"
key: "${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**\\composer.lock') }}"
restore-keys: |
${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-

- name: "Install lowest dependencies"
if: ${{ matrix.dependencies == 'lowest' }}
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"

- name: "Install highest dependencies"
if: ${{ matrix.dependencies == 'highest' }}
run: "composer update --no-interaction --no-progress --no-suggest"

- name: "Install locked dependencies"
if: ${{ matrix.dependencies == 'locked' }}
run: "composer install --no-interaction --no-progress --no-suggest"

# Please see note at top why only running unit tests
- name: "Test"
run: "composer test -- --testsuite unit"
2 changes: 1 addition & 1 deletion src/lib/filesystem/src/Flow/Filesystem/Path.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function __construct(string $uri, array|Options $options = [])

$path = \str_replace($scheme . '://', '', $uri);

if (!\str_starts_with($path, DIRECTORY_SEPARATOR)) {
if (PHP_OS_FAMILY !== 'Windows' && !\str_starts_with($path, DIRECTORY_SEPARATOR)) {
$path = DIRECTORY_SEPARATOR . $path;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
use function Flow\Filesystem\DSL\{partition, partitions, path, path_real};
use Flow\Filesystem\Partitions;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\RequiresOperatingSystemFamily;
use PHPUnit\Framework\TestCase;

final class PathTest extends TestCase
#[RequiresOperatingSystemFamily('Linux')]
final class PathOnUnixTest extends TestCase
{
public static function directories() : \Generator
{
Expand Down
Loading
Loading