diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..50814af --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,32 @@ +--- +name: Test jobs + +on: + - push + - pull_request + # Allow manually triggering the workflow. + - workflow_dispatch + +# Cancels all previous workflow runs for the same branch that have not yet completed. +concurrency: + # The concurrency group contains the workflow name and the branch name. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + phpunit: + runs-on: ubuntu-20.04 + + strategy: + matrix: + php: ['8.0', '8.1'] + + steps: + - uses: actions/checkout@v3 + - uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + - uses: "ramsey/composer-install@v2" + with: + composer-options: --no-scripts + - run: bin/phpunit diff --git a/composer.json b/composer.json index e4a6855..a8233be 100644 --- a/composer.json +++ b/composer.json @@ -36,5 +36,8 @@ "dev:example": "Run internal PHP development server with example code", "tests:unit": "Run unit-test with PHPUnit" }, - "type": "library" + "type": "library", + "require-dev": { + "phpunit/phpunit": "^9" + } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..e1791a5 --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,33 @@ + + + + + tests/ + + + + + + src/ + + + + + + + + \ No newline at end of file diff --git a/tests/dummyTest.php b/tests/dummyTest.php new file mode 100644 index 0000000..4f94796 --- /dev/null +++ b/tests/dummyTest.php @@ -0,0 +1,20 @@ +assertTrue(true); + } +} \ No newline at end of file