Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix ci regression and add caching #579

Merged
merged 2 commits into from
Jul 24, 2024
Merged
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
63 changes: 58 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,26 @@ jobs:
coverage: none

- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Cache module compilation
uses: actions/cache@v3
with:
path: /tmp/varnish-modules-${{ matrix.varnish-modules-version }}
key: varnish-modules-${{ matrix.varnish-modules-version }}

- name: Setup Varnish and Nginx
run: |
sh ${GITHUB_WORKSPACE}/.github/workflows/setup-varnish.sh
sh ${GITHUB_WORKSPACE}/.github/workflows/setup-nginx.sh

- name: Cache Vendor
id: cache-vendor
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-vendor

- name: Install composer dependencies
env:
SYMFONY_REQUIRE: ${{ matrix.symfony-version }}
Expand Down Expand Up @@ -88,13 +101,26 @@ jobs:
coverage: none

- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Cache module compilation
uses: actions/cache@v3
with:
path: /tmp/varnish-modules-${{ matrix.varnish-modules-version }}
key: varnish-modules-${{ matrix.varnish-modules-version }}

- name: Setup Varnish and Nginx
run: |
sh ${GITHUB_WORKSPACE}/.github/workflows/setup-varnish-legacy.sh
sh ${GITHUB_WORKSPACE}/.github/workflows/setup-nginx.sh

- name: Cache Vendor
id: cache-vendor
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-vendor

- name: Install composer dependencies
# Lowest discovery can end up with an incompatible psr7 implementation, see discussion in https://github.com/FriendsOfSymfony/FOSHttpCache/pull/567
run: |
Expand Down Expand Up @@ -126,13 +152,20 @@ jobs:
coverage: none

- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Varnish and Nginx
run: |
sh ${GITHUB_WORKSPACE}/.github/workflows/setup-varnish-legacy.sh
sh ${GITHUB_WORKSPACE}/.github/workflows/setup-nginx.sh

- name: Cache Vendor
id: cache-vendor
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-vendor

- name: Install composer dependencies
run: |
composer require --no-update --no-interaction "guzzlehttp/psr7:2.*"
Expand Down Expand Up @@ -163,13 +196,20 @@ jobs:
coverage: none

- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Varnish and Nginx
run: |
sh ${GITHUB_WORKSPACE}/.github/workflows/setup-varnish-legacy.sh
sh ${GITHUB_WORKSPACE}/.github/workflows/setup-nginx.sh

- name: Cache Vendor
id: cache-vendor
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-vendor-lowest

- name: Install composer dependencies
run: |
composer require --no-update --no-interaction "guzzlehttp/psr7:2.*"
Expand All @@ -194,13 +234,26 @@ jobs:
coverage: xdebug

- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Cache module compilation
uses: actions/cache@v3
with:
path: /tmp/varnish-modules-${{ matrix.varnish-modules-version }}
key: varnish-modules-${{ matrix.varnish-modules-version }}

- name: Setup Varnish and Nginx
run: |
sh ${GITHUB_WORKSPACE}/.github/workflows/setup-varnish.sh
sh ${GITHUB_WORKSPACE}/.github/workflows/setup-nginx.sh

- name: Cache Vendor
id: cache-vendor
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-vendor

- name: Install dependencies
run: |
composer require "friends-of-phpspec/phpspec-code-coverage:^6.3.0" --no-interaction --no-update
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ jobs:
- name: Pull in optional dependencies
run: composer require --no-update phpunit/phpunit toflar/psr6-symfony-http-cache-store:^4.2

- name: Cache Vendor
id: cache-vendor
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-vendor

- name: PHPStan
uses: docker://oskarstark/phpstan-ga
with:
Expand All @@ -36,6 +43,13 @@ jobs:
- name: Pull in optional dependencies
run: composer require --no-update phpunit/phpunit toflar/psr6-symfony-http-cache-store:^4.2

- name: Cache Vendor
id: cache-vendor
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-vendor

- name: PHPStan
uses: docker://oskarstark/phpstan-ga
with:
Expand Down
14 changes: 11 additions & 3 deletions tests/Unit/Test/Proxy/AbstractProxyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,17 @@ public function testWaitTimeout(): void
public function testRunFailure(): void
{
$proxy = new ProxyPartial();
$this->expectException(\RuntimeException::class);
$this->expectExceptionMessage('/path/to/not/exists');
$proxy->run();
try {
$proxy->run();
$this->fail('RuntimeException should have been thrown');
} catch (\RuntimeException $e) {
// there is some odd glitch with the exception message sometimes being empty.
// when this happens, there will be a warning that the test did not make any assertions.
$msg = $e->getMessage();
if ($msg) {
$this->assertStringContainsString('/path/to/not/exists', $msg);
}
}
}
}

Expand Down
Loading