name: Tests

on:
    pull_request: ~
    push: ~
    workflow_dispatch: ~

env:
    # see https://github.com/composer/composer/issues/9368#issuecomment-718112361
    COMPOSER_ROOT_VERSION: "dev-main"

jobs:
    tests:
        runs-on: ubuntu-latest

        name: Tests
        steps:
            -   uses: actions/checkout@v2

            -
                uses: shivammathur/setup-php@v2
                with:
                    php-version: 8.1
                    coverage: none

            -   uses: "ramsey/composer-install@v1"

            -   run: vendor/bin/phpunit tests

            -   run: vendor/bin/phpstan analyse
