From f7c93b70f550d618d68f29b170b74ae8ae51a60b Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Wed, 18 Dec 2024 11:07:47 +0100 Subject: [PATCH 1/3] CI: Setup phpunit github action (#1) --- .github/FUNDING.yml | 1 + .github/workflows/php-linter.yml | 29 ++++++++++++++++++++ .github/workflows/unit-tests.yml | 45 ++++++++++++++++++++++++++++++++ .gitignore | 3 ++- 4 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 .github/FUNDING.yml create mode 100644 .github/workflows/php-linter.yml create mode 100644 .github/workflows/unit-tests.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..bd17639 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: [staabm] diff --git a/.github/workflows/php-linter.yml b/.github/workflows/php-linter.yml new file mode 100644 index 0000000..9a8180b --- /dev/null +++ b/.github/workflows/php-linter.yml @@ -0,0 +1,29 @@ +name: PHP Linter + +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +jobs: + php-linter: + runs-on: ubuntu-latest + if: github.event.pull_request.draft == false + + steps: + - uses: actions/checkout@v4 + with: + repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }} + ref: ${{ github.event.client_payload.pull_request.head.ref }} + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 7.4 + coverage: none + tools: parallel-lint + + - name: Lint PHP + run: composer exec --no-interaction -- parallel-lint bin/ lib/ tests/ diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml new file mode 100644 index 0000000..0ae22d9 --- /dev/null +++ b/.github/workflows/unit-tests.yml @@ -0,0 +1,45 @@ +name: Unit tests + +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +jobs: + phpunit: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + include: + - os: ubuntu-latest + php-version: '7.4' + - os: ubuntu-latest + php-version: '8.0' + - os: ubuntu-latest + php-version: '8.1' + - os: ubuntu-latest + php-version: '8.2' + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + coverage: none # disable xdebug, pcov + + - name: Composer install + uses: ramsey/composer-install@v3 + with: + composer-options: '--ansi --prefer-dist' + + - name: Setup Problem Matchers for PHPUnit + run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + + - name: Run unit tests + run: vendor/bin/phpunit --colors=always diff --git a/.gitignore b/.gitignore index f6134a2..92f7dcb 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ bundles/* !bundles/. -.idea \ No newline at end of file +.idea +.phpunit.result.cache From d872a03c8cded76410114b7146348e73142e2e00 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Wed, 18 Dec 2024 11:11:17 +0100 Subject: [PATCH 2/3] Setup Dependabot (#2) --- .github/dependabot.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..0f111c6 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,15 @@ +# Dependabot config reference +# https://help.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: composer + directory: / + versioning-strategy: increase + schedule: + interval: monthly + + - package-ecosystem: github-actions + directory: / + schedule: + interval: monthly From ecd07527debadd9bf61885960403cd1908898823 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 4 Oct 2021 18:43:19 +0200 Subject: [PATCH 3/3] fix phpdocs --- src/AbstractPasswordExposedChecker.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/AbstractPasswordExposedChecker.php b/src/AbstractPasswordExposedChecker.php index ef8d7a5..bc6a268 100644 --- a/src/AbstractPasswordExposedChecker.php +++ b/src/AbstractPasswordExposedChecker.php @@ -106,7 +106,7 @@ public function isExposedByHash(string $hash): ?bool } /** - * @param $hash + * @param string $hash * * @throws \Psr\Http\Client\ClientExceptionInterface * @@ -121,7 +121,7 @@ protected function makeRequest(string $hash): ResponseInterface } /** - * @param $string + * @param string $string * * @return string */