Skip to content

Commit

Permalink
Merge pull request #1116 from mfn/mfn-tests
Browse files Browse the repository at this point in the history
gha: fix failing tests
  • Loading branch information
mfn authored Feb 16, 2024
2 parents 7b73ed2 + 5afc503 commit cd37cca
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 35 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

- uses: shivammathur/setup-php@v2
with:
php-version: 8.2
php-version: 8.3
coverage: none

# Remove unnecessary dependencies not needed in this context
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:

- uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.2
coverage: none

- name: Get composer cache directory
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,11 @@ on:
workflow_dispatch:

jobs:
supported-versions-matrix:
name: Supported Versions Matrix
runs-on: ubuntu-latest
outputs:
version: ${{ steps.supported-versions-matrix.outputs.version }}
steps:
- uses: actions/checkout@v4
- id: supported-versions-matrix
uses: WyriHaximus/github-action-composer-php-versions-in-range@v1

integration:
needs:
- supported-versions-matrix
strategy:
fail-fast: false
matrix:
php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }}
php: [8.0, 8.1, 8.2, 8.3]
laravel: [^9.0, ^10.0]
exclude:
- php: 8.0
Expand All @@ -52,7 +40,7 @@ jobs:
coverage: none

# Due to version incompatibility with older Laravels we test, we remove it
- run: composer remove --dev nunomaduro/larastan --no-update
- run: composer remove --dev larastan/larastan --no-update
- run: composer remove --dev friendsofphp/php-cs-fixer --no-update
- run: composer require illuminate/contracts:${{ matrix.laravel }} --no-update

Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,11 @@ on:
workflow_dispatch:

jobs:
supported-versions-matrix:
name: Supported Versions Matrix
runs-on: ubuntu-latest
outputs:
version: ${{ steps.supported-versions-matrix.outputs.version }}
steps:
- uses: actions/checkout@v4
- id: supported-versions-matrix
uses: WyriHaximus/github-action-composer-php-versions-in-range@v1

tests:
needs:
- supported-versions-matrix
strategy:
fail-fast: false
matrix:
php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }}
php: [8.0, 8.1, 8.2, 8.3]
laravel: [^9.0, ^10.0]
stability: [prefer-lowest, prefer-stable]
exclude:
Expand All @@ -54,7 +42,7 @@ jobs:
extensions: pdo_sqlite

# Due to version incompatibility with older Laravels we test, we remove it
- run: composer remove --dev nunomaduro/larastan --no-update
- run: composer remove --dev larastan/larastan --no-update
- run: composer remove --dev friendsofphp/php-cs-fixer --no-update
- run: composer require illuminate/contracts:${{ matrix.laravel }} --no-update
- run: composer require illuminate/contracts:9.33 --no-update
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM php:8.2.7-cli-alpine
FROM php:8.3.2-cli-alpine

COPY --from=mlocati/php-extension-installer:2.1.30 /usr/bin/install-php-extensions /usr/local/bin/
COPY --from=mlocati/php-extension-installer:2.2.2 /usr/bin/install-php-extensions /usr/local/bin/

RUN install-php-extensions \
xdebug && \
rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini

COPY --from=composer:2.5.7 /usr/bin/composer /usr/local/bin/
COPY --from=composer:2.7.1 /usr/bin/composer /usr/local/bin/

RUN mkdir /app

Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ parameters:
- '/Property Rebing\\GraphQL\\Support\\Field\:\:\$name \(string\) does not accept int\|string/'
- '/Parameter #1 \$name of method Rebing\\GraphQL\\Support\\Type\:\:getFieldResolver\(\) expects string, int\|string given/'
# Mass ignore the raw array property access used in many tests for now
# See also https://github.com/nunomaduro/larastan/issues/611
# See also https://github.com/larastan/larastan/issues/611
-
path: tests/*
message: '/Cannot access property \$[a-z]+ on Rebing\\GraphQL\\Tests\\Support\\Models\\[A-Za-z]+\|null./'
Expand Down
2 changes: 1 addition & 1 deletion tests/integration-laravel.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

# Inspired by https://github.com/nunomaduro/larastan/blob/669b489e10558bd45fafc2429068fd4a73843802/tests/laravel-test.sh
# Inspired by https://github.com/larastan/larastan/blob/669b489e10558bd45fafc2429068fd4a73843802/tests/laravel-test.sh
#
# Create a fresh Laravel installation, install our package in it and run some
# basic tests to ensure everything works.
Expand Down

0 comments on commit cd37cca

Please sign in to comment.