Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasbestle committed Jan 14, 2024
1 parent 1cf9742 commit 8456dd6
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 37 deletions.
50 changes: 25 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,39 @@ jobs:
timeout-minutes: 5
strategy:
matrix:
php: ["8.0", "8.1", "8.2"]
php: ["8.1", "8.2", "8.3"]
dependencies: ["lowest", "locked"]
env:
extensions: mbstring, pcov
ini: pcov.directory=., "pcov.exclude=\"~(vendor|tests)~\""

steps:
- name: Checkout
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # pin@v3
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # pin@v3

- name: Setup PHP cache environment
id: ext-cache
uses: shivammathur/cache-extensions@fc01a9cdc93341e96c2078d848f2e96240d83c17 # pin@v1
uses: shivammathur/cache-extensions@d776e47f06e6e567f0c77a43f9054fb0753993d7 # pin@v1
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.extensions }}
key: php-v1

- name: Cache PHP extensions
uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d # pin@v3
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # pin@v3
with:
path: ${{ steps.ext-cache.outputs.dir }}
key: ${{ steps.ext-cache.outputs.key }}
restore-keys: ${{ steps.ext-cache.outputs.key }}

- name: Setup PHP environment
uses: shivammathur/setup-php@3eda58347216592f618bb1dff277810b6698e4ca # pin@v2
uses: shivammathur/setup-php@7fdd3ece872ec7ec4c098ae5ab7637d5e0a96067 # pin@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.extensions }}
ini-values: ${{ env.ini }}
coverage: pcov
tools: phpunit:9.5.13, psalm:4.30.0
tools: phpunit:10.5.5, psalm:5.15.0

- name: Setup problem matchers
run: |
Expand All @@ -53,7 +53,7 @@ jobs:
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d # pin@v3
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # pin@v3
with:
path: ${{ steps.composerCache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}
Expand All @@ -67,7 +67,7 @@ jobs:
- name: Cache analysis data
id: finishPrepare
uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d # pin@v3
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # pin@v3
with:
path: ~/.cache/psalm
key: backend-analysis-${{ matrix.php }}-v2
Expand All @@ -81,7 +81,7 @@ jobs:
run: psalm --output-format=github --php-version=${{ matrix.php }}

- name: Upload coverage results to Codecov
uses: codecov/codecov-action@66b3de25f6f91f65eb92c514d31d6b6f13d5ab18 # pin@v3
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # pin@v3
with:
file: ${{ github.workspace }}/clover.xml
flags: backend
Expand All @@ -95,38 +95,38 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 5
env:
php: "8.0"
php: "8.2"
extensions: mbstring

steps:
- name: Checkout
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # pin@v3
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # pin@v3

- name: Setup PHP cache environment
id: ext-cache
uses: shivammathur/cache-extensions@fc01a9cdc93341e96c2078d848f2e96240d83c17 # pin@v1
uses: shivammathur/cache-extensions@d776e47f06e6e567f0c77a43f9054fb0753993d7 # pin@v1
with:
php-version: ${{ env.php }}
extensions: ${{ env.extensions }}
key: php-v1

- name: Cache PHP extensions
uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d # pin@v3
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # pin@v3
with:
path: ${{ steps.ext-cache.outputs.dir }}
key: ${{ steps.ext-cache.outputs.key }}
restore-keys: ${{ steps.ext-cache.outputs.key }}

- name: Setup PHP environment
id: finishPrepare
uses: shivammathur/setup-php@3eda58347216592f618bb1dff277810b6698e4ca # pin@v2
uses: shivammathur/setup-php@7fdd3ece872ec7ec4c098ae5ab7637d5e0a96067 # pin@v2
with:
php-version: ${{ env.php }}
extensions: ${{ env.extensions }}
coverage: none
tools: |
composer:2.3.7, composer-normalize:2.28.0,
composer-unused:0.7.12, phpcpd:6.0.3, phpmd:2.12.0
composer:2.4.4, composer-normalize:2.28.3,
composer-unused:0.7.12, phpcpd:6.0.3, phpmd:2.13.0
- name: Validate composer.json/composer.lock
if: always() && steps.finishPrepare.outcome == 'success'
Expand All @@ -144,7 +144,7 @@ jobs:
- name: Cache dependencies
id: composerCache2
if: always() && steps.composerCache1.outcome == 'success'
uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d # pin@v3
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # pin@v3
with:
path: ${{ steps.composerCache1.outputs.dir }}
key: ${{ runner.os }}-composer-locked-${{ hashFiles('**/composer.lock') }}
Expand Down Expand Up @@ -175,25 +175,25 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # pin@v3
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # pin@v3

- name: Set up Node.js problem matchers and cache npm dependencies
uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # pin@v3
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # pin@v3
with:
cache: 'npm'

- name: Install npm dependencies
run: npm ci

- name: Setup PHP environment
uses: shivammathur/setup-php@3eda58347216592f618bb1dff277810b6698e4ca # pin@v2
uses: shivammathur/setup-php@7fdd3ece872ec7ec4c098ae5ab7637d5e0a96067 # pin@v2
with:
coverage: none
tools: php-cs-fixer:3.8.0
tools: php-cs-fixer:3.13.0

- name: Cache analysis data
id: finishPrepare
uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d # pin@v3
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # pin@v3
with:
path: ~/.php-cs-fixer
key: coding-style
Expand All @@ -209,7 +209,7 @@ jobs:
if: >
always() && steps.finishPrepare.outcome == 'success' &&
github.event_name == 'pull_request'
uses: reviewdog/action-suggester@ab82daa6ea9b84fe43db7747bb10fa087f34e1ab # pin@v1
uses: reviewdog/action-suggester@3f60d0e826f0873905e0eeca522d562a6e67afbd # pin@v1
with:
tool_name: ESLint
fail_on_error: "true"
Expand All @@ -225,7 +225,7 @@ jobs:
if: >
always() && steps.finishPrepare.outcome == 'success' &&
github.event_name == 'pull_request'
uses: reviewdog/action-suggester@ab82daa6ea9b84fe43db7747bb10fa087f34e1ab # pin@v1
uses: reviewdog/action-suggester@3f60d0e826f0873905e0eeca522d562a6e67afbd # pin@v1
with:
tool_name: Prettier
fail_on_error: "true"
Expand All @@ -243,7 +243,7 @@ jobs:
if: >
always() && steps.finishPrepare.outcome == 'success' &&
github.event_name == 'pull_request'
uses: reviewdog/action-suggester@ab82daa6ea9b84fe43db7747bb10fa087f34e1ab # pin@v1
uses: reviewdog/action-suggester@3f60d0e826f0873905e0eeca522d562a6e67afbd # pin@v1
with:
tool_name: PHP-CS-Fixer
fail_on_error: "true"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
# Cache and temporary files
/.cache
/.php-cs-fixer.cache
/.phpunit.result.cache
/.phpunit.cache
/tests/coverage
/tests/*/tmp
19 changes: 8 additions & 11 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
<?xml version="1.0"?>

<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"

xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
bootstrap="tests/bootstrap.php"
cacheDirectory=".phpunit.cache"
colors="true"
forceCoversAnnotation="true"
verbose="true"
stderr="true"
requireCoverageMetadata="true"
>
<coverage>
<include>
<directory>./src/classes</directory>
</include>
</coverage>

<testsuites>
<testsuite name="Tests">
<directory>./tests/</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory>./src/classes</directory>
</include>
</source>
</phpunit>

0 comments on commit 8456dd6

Please sign in to comment.