Skip to content

Commit

Permalink
Add github actions, add psalm
Browse files Browse the repository at this point in the history
  • Loading branch information
xPaw committed Nov 27, 2023
1 parent f9470f1 commit 548ab59
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI

permissions:
contents: read

on: [push]

jobs:
php:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['8.0', '8.1', '8.2', '8.3']
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- uses: actions/checkout@v4

- name: Install dependencies
run: composer install --no-interaction --no-progress

- name: Run phpstan
run: php vendor/bin/phpstan

- name: Run psalm
run: php vendor/bin/psalm
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
},
"require-dev":
{
"phpstan/phpstan": "^1.4"
"phpstan/phpstan": "^1.10",
"vimeo/psalm": "^5.16"
},
"autoload":
{
Expand Down
18 changes: 18 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<psalm
errorLevel="2"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
findUnusedBaselineEntry="true"
findUnusedCode="true"
>
<projectFiles>
<directory name="src" />
<directory name="." />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
</psalm>
2 changes: 1 addition & 1 deletion view.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

// Display everything in browser, because some people can't look in logs for errors
error_reporting( E_ALL | E_STRICT );
ini_set( 'display_errors', true );
ini_set( 'display_errors', '1' );

require __DIR__ . '/src/MinecraftQuery.php';
require __DIR__ . '/src/MinecraftQueryException.php';
Expand Down
2 changes: 1 addition & 1 deletion view_serverping.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

// Display everything in browser, because some people can't look in logs for errors
error_reporting( E_ALL | E_STRICT );
ini_set( 'display_errors', true );
ini_set( 'display_errors', '1' );

require __DIR__ . '/src/MinecraftPing.php';
require __DIR__ . '/src/MinecraftPingException.php';
Expand Down

0 comments on commit 548ab59

Please sign in to comment.