Skip to content

Commit 6cb97ad

Browse files
committed
Update CI config
1 parent 9e8b3fe commit 6cb97ad

File tree

4 files changed

+10
-99
lines changed

4 files changed

+10
-99
lines changed

.gitattributes

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
.editorconfig export-ignore
44
.gitattributes export-ignore
55
.gitignore export-ignore
6-
phpcs.xml.dist export-ignore
6+
phpcs.xml export-ignore
77
phpstan.neon export-ignore
88
phpstan-baseline.neon export-ignore
99
phpunit.xml.dist export-ignore

.github/workflows/ci.yml

+7-91
Original file line numberDiff line numberDiff line change
@@ -8,98 +8,14 @@ on:
88
branches:
99
- '*'
1010

11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
testsuite:
13-
runs-on: ubuntu-22.04
14-
strategy:
15-
fail-fast: false
16-
matrix:
17-
php-version: ['8.1', '8.2']
18-
db-type: [sqlite, mysql, pgsql]
19-
prefer-lowest: ['']
20-
include:
21-
- php-version: '8.1'
22-
db-type: 'sqlite'
23-
prefer-lowest: 'prefer-lowest'
24-
25-
services:
26-
postgres:
27-
image: postgres
28-
ports:
29-
- 5432:5432
30-
env:
31-
POSTGRES_PASSWORD: postgres
32-
33-
steps:
34-
- uses: actions/checkout@v4
35-
36-
- name: Setup Service
37-
if: matrix.db-type == 'mysql'
38-
run: |
39-
sudo service mysql start
40-
mysql -h 127.0.0.1 -u root -proot -e 'CREATE DATABASE cakephp;'
41-
42-
- name: Setup PHP
43-
uses: shivammathur/setup-php@v2
44-
with:
45-
php-version: ${{ matrix.php-version }}
46-
extensions: mbstring, intl, pdo_${{ matrix.db-type }}
47-
coverage: pcov
48-
49-
- name: Composer install
50-
run: |
51-
if ${{ matrix.prefer-lowest == 'prefer-lowest' }}; then
52-
composer update --prefer-lowest --prefer-stable
53-
else
54-
composer install
55-
fi
56-
57-
- name: Setup problem matchers for PHPUnit
58-
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
59-
60-
- name: Run PHPUnit
61-
run: |
62-
if [[ ${{ matrix.db-type }} == 'sqlite' ]]; then export DB_URL='sqlite:///:memory:'; fi
63-
if [[ ${{ matrix.db-type }} == 'mysql' ]]; then export DB_URL='mysql://root:[email protected]/cakephp'; fi
64-
if [[ ${{ matrix.db-type }} == 'pgsql' ]]; then export DB_URL='postgres://postgres:[email protected]/postgres'; fi
65-
if [[ ${{ matrix.php-version }} == '8.1' ]]; then
66-
vendor/bin/phpunit --coverage-clover=coverage.xml
67-
else
68-
vendor/bin/phpunit
69-
fi
70-
71-
- name: Code Coverage Report
72-
if: success() && matrix.php-version == '8.1'
73-
uses: codecov/codecov-action@v3
16+
uses: ADmad/.github/.github/workflows/testsuite-with-db.yml@master
17+
secrets: inherit
7418

7519
cs-stan:
76-
name: Coding Standard & Static Analysis
77-
runs-on: ubuntu-22.04
78-
79-
steps:
80-
- uses: actions/checkout@v4
81-
82-
- name: Setup PHP
83-
uses: shivammathur/setup-php@v2
84-
with:
85-
php-version: '8.1'
86-
extensions: mbstring, intl
87-
coverage: none
88-
tools: phive, cs2pr
89-
90-
- name: Composer install
91-
uses: ramsey/composer-install@v2
92-
93-
- name: Install PHP tools with phive.
94-
run: "phive install --trust-gpg-keys 'CF1A108D0E7AE720,51C67305FFC2E5C0,12CE0F1D262429A5'"
95-
96-
- name: Run phpcs
97-
run: vendor/bin/phpcs --report=checkstyle src/ tests/ | cs2pr
98-
99-
- name: Run psalm
100-
if: always()
101-
run: tools/psalm --output-format=github
102-
103-
- name: Run phpstan
104-
if: always()
105-
run: tools/phpstan analyse --error-format=github
20+
uses: ADmad/.github/.github/workflows/cs-stan.yml@master
21+
secrets: inherit

.phive/phars.xml

-5
This file was deleted.

phpstan-baseline.neon

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ parameters:
66
path: src/Middleware/SocialAuthMiddleware.php
77

88
-
9-
message: "#^Method ADmad\\\\SocialAuth\\\\Plugin\\:\\:bootstrap\\(\\) has parameter \\$app with generic interface Cake\\\\Core\\\\PluginApplicationInterface but does not specify its types\\: TSubject$#"
9+
message: "#^Method ADmad\\\\SocialAuth\\\\SocialAuthPlugin\\:\\:bootstrap\\(\\) has parameter \\$app with generic interface Cake\\\\Core\\\\PluginApplicationInterface but does not specify its types\\: TSubject$#"
1010
count: 1
11-
path: src/Plugin.php
11+
path: src/SocialAuthPlugin.php

0 commit comments

Comments
 (0)