Skip to content

Commit

Permalink
Add github CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rvogel committed Jan 26, 2022
1 parent 85f7983 commit 8a284dd
Show file tree
Hide file tree
Showing 6 changed files with 3,563 additions and 14 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: basic-tests

on: push

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
tools: composer:2

- name: Install dependencies
run: composer update

- name: Run check coding conventions
run: composer test

- name: Run unit tests
run: composer unittest
8 changes: 8 additions & 0 deletions .phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<ruleset>
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
</rule>
<file>.</file>
<arg name="extensions" value="php"/>
<arg name="encoding" value="UTF-8"/>
</ruleset>
8 changes: 8 additions & 0 deletions .phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>
<phpunit bootstrap="vendor/autoload.php">
<testsuites>
<testsuite name="all">
<directory suffix="Test.php">./tests/phpunit</directory>
</testsuite>
</testsuites>
</phpunit>
28 changes: 25 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,42 @@
"name": "hallowelt/mediawiki-lib-commandline-tools",
"description": "Class library for various command line applications for MediaWiki",
"type": "library",
"require-dev": {
"phpunit/phpunit": "^6.5"
},
"license": "GPL-3.0-only",
"authors": [
{
"name": "Robert Vogel",
"email": "vogel@hallowelt.com"
}
],
"require-dev": {
"mediawiki/mediawiki-codesniffer": "31.0.0",
"mediawiki/mediawiki-phan-config": "0.11.0",
"mediawiki/minus-x": "1.1.1",
"jakub-onderka/php-parallel-lint": "1.0.0",
"jakub-onderka/php-console-highlighter": "0.4.0",
"phpunit/phpunit": "^8"
},
"autoload": {
"psr-4": {
"HalloWelt\\MediaWiki\\Lib\\CommandLineTools\\": "src/",
"HalloWelt\\MediaWiki\\Lib\\CommandLineTools\\Tests\\": "tests/phpunit/"
}
},
"scripts": {
"unittest": [
"vendor/phpunit/phpunit/phpunit --configuration .phpunit.xml"
],
"test": [
"parallel-lint . --exclude vendor --exclude node_modules",
"minus-x check .",
"phpcs -sp"
],
"fix": [
"minus-x fix .",
"phpcbf"
],
"lint": [
"phan --no-progress-bar -m text | sed 's, ,:,'"
]
}
}
Loading

0 comments on commit 8a284dd

Please sign in to comment.