Skip to content
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
1 change: 1 addition & 0 deletions .github/FUNDING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: byjg
57 changes: 39 additions & 18 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ on:
pull_request:
branches:
- master
schedule:
- cron: "0 9 * * 1"

jobs:
Build:
runs-on: 'ubuntu-latest'
container: 'byjg/php:${{ matrix.php-version }}-cli'
container:
image: 'byjg/php:${{ matrix.php-version }}-cli'
options: --user root --privileged
strategy:
matrix:
php-version:
- "8.5"
- "8.4"
- "8.3"
- "8.2"
- "8.1"

services:
mysql:
Expand Down Expand Up @@ -64,22 +64,42 @@ jobs:
MSSQL_TEST_HOST: sqlserver

steps:
- uses: actions/checkout@v4
# - name: Spin up databases
# run: |
# apk add --no-cache python3 python3-dev py3-pip build-base libffi-dev
# pip3 install --upgrade pip
# pip3 install docker-compose
# apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community docker
# docker-compose up -d postgres mysql
- uses: actions/checkout@v5
- run: composer install
- run: ./vendor/bin/psalm
- run: ./vendor/bin/phpunit
- run: composer test
- run: ./vendor/bin/phpunit tests/SqliteDatabase*
- run: ./vendor/bin/phpunit tests/MysqlDatabase*
- run: ./vendor/bin/phpunit tests/PostgresDatabase*
# - run: ./vendor/bin/phpunit tests/SqlServerSqlsrv*
# - run: ./vendor/bin/phpunit tests/SqlServerDblib*

Psalm:
name: Psalm Static Analyzer
runs-on: ubuntu-latest
permissions:
# for github/codeql-action/upload-sarif to upload SARIF results
security-events: write
container:
image: byjg/php:8.4-cli
options: --user root --privileged

steps:
- name: Git checkout
uses: actions/checkout@v4

- name: Composer
run: composer install

- name: Psalm
# Note: Ignoring error code 2, which just signals that some
# flaws were found, not that Psalm itself failed to run.
run: ./vendor/bin/psalm
--show-info=true
--report=psalm-results.sarif || [ $? = 2 ]

- name: Upload Analysis results to GitHub
uses: github/codeql-action/upload-sarif@v4
if: github.ref == 'refs/heads/master'
with:
sarif_file: psalm-results.sarif

Documentation:
if: github.ref == 'refs/heads/master'
Expand All @@ -88,5 +108,6 @@ jobs:
with:
folder: php
project: ${{ github.event.repository.name }}
secrets: inherit
secrets:
DOC_TOKEN: ${{ secrets.DOC_TOKEN }}

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,7 @@ fabric.properties
node_modules
package-lock.json
.usdocker
phpunit.coverage.xml
phpunit.report.xml
.phpunit.result.cache
*.bak
28 changes: 28 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
tasks:
- name: Run Composer
command: |
composer install

image: byjg/gitpod-image:latest

jetbrains:
phpstorm:
vmoptions: '-Xmx4g'
plugins:
- com.github.copilot
- com.intellij.kubernetes
- com.intellij.mermaid
- ru.adelf.idea.dotenv
- org.toml.lang

vscode:
extensions:
- ikappas.composer
- hbenl.test-adapter-converter
- hbenl.vscode-test-explorer
- felixfbecker.php-debug
- neilbrayfield.php-docblocker
- bmewburn.vscode-intelephense-client
- getpsalm.psalm-vscode-plugin
- SonarSource.sonarlint-vscode
- recca0120.vscode-phpunit
2 changes: 1 addition & 1 deletion .idea/runConfigurations/PHPUnit.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions .idea/runConfigurations/Psalm.xml

This file was deleted.

1 change: 1 addition & 0 deletions .idea/runConfigurations/Run_Databases.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/runConfigurations/psalm.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug current Script in Console",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9003,
"runtimeArgs": [
"-dxdebug.start_with_request=yes"
],
"env": {
"XDEBUG_MODE": "debug,develop",
"XDEBUG_CONFIG": "client_port=${port}"
}
},
{
"name": "PHPUnit Debug",
"type": "php",
"request": "launch",
"program": "${workspaceFolder}/vendor/bin/phpunit",
"cwd": "${workspaceFolder}",
"port": 9003,
"runtimeArgs": [
"-dxdebug.start_with_request=yes"
],
"env": {
"XDEBUG_MODE": "debug,develop",
"XDEBUG_CONFIG": "client_port=${port}"
}
}
]
}
Loading