diff --git a/.github/FUNDING.md b/.github/FUNDING.md new file mode 100644 index 0000000..163530b --- /dev/null +++ b/.github/FUNDING.md @@ -0,0 +1 @@ +github: byjg \ No newline at end of file diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 2cc2446..36c59bd 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -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: @@ -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' @@ -88,5 +108,6 @@ jobs: with: folder: php project: ${{ github.event.repository.name }} - secrets: inherit + secrets: + DOC_TOKEN: ${{ secrets.DOC_TOKEN }} diff --git a/.gitignore b/.gitignore index c51a039..25e8827 100644 --- a/.gitignore +++ b/.gitignore @@ -51,4 +51,7 @@ fabric.properties node_modules package-lock.json .usdocker +phpunit.coverage.xml +phpunit.report.xml .phpunit.result.cache +*.bak diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 0000000..335de09 --- /dev/null +++ b/.gitpod.yml @@ -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 \ No newline at end of file diff --git a/.idea/runConfigurations/PHPUnit.xml b/.idea/runConfigurations/PHPUnit.xml index 5b1e3d2..f81c245 100644 --- a/.idea/runConfigurations/PHPUnit.xml +++ b/.idea/runConfigurations/PHPUnit.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.idea/runConfigurations/Psalm.xml b/.idea/runConfigurations/Psalm.xml deleted file mode 100644 index 6f80a21..0000000 --- a/.idea/runConfigurations/Psalm.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/runConfigurations/Run_Databases.xml b/.idea/runConfigurations/Run_Databases.xml index 56bd727..c561741 100644 --- a/.idea/runConfigurations/Run_Databases.xml +++ b/.idea/runConfigurations/Run_Databases.xml @@ -2,6 +2,7 @@ +