diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..99c61a4 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,51 @@ +name: Tests +on: + push: + branches: [ "**" ] + pull_request: + +jobs: + tests: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php: ["8.3", "8.4"] + + name: PHP ${{ matrix.php }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: none + tools: composer + extensions: json, mbstring, ctype, openssl, tokenizer, pdo, curl + + - name: Validate composer.json + run: composer validate --no-check-publish + + - name: Install dependencies + run: composer update --no-interaction --prefer-dist --ansi + + - name: Run tests + run: vendor/bin/phpunit --no-coverage + + phplint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: shivammathur/setup-php@v2 + with: + php-version: '8.3' + + - name: Install dependencies + run: composer install --no-interaction --prefer-dist + + - name: Run laravel pint + run: ./vendor/bin/pint --test diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml deleted file mode 100644 index 50e16d0..0000000 --- a/.github/workflows/unit-tests.yml +++ /dev/null @@ -1,44 +0,0 @@ -on: - push: - branches: - - master - pull_request: - branches: - - master -jobs: - unit-tests: - runs-on: ubuntu-latest - name: unit-tests - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 10 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.3' - coverage: xdebug - - - name: Install dependencies - run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist - - - name: Execute tests - Unit - run: vendor/bin/phpunit --testsuite Unit - phplint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 10 - - uses: shivammathur/setup-php@v2 - with: - php-version: '8.3' - coverage: xdebug - - - name: Install dependencies - run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist - - - name: Run laravel pint - run: ./vendor/bin/pint --test diff --git a/composer.json b/composer.json index e3c4154..2dc4b03 100644 --- a/composer.json +++ b/composer.json @@ -1,12 +1,12 @@ { "name": "lukewaite/monolog-memory-usage-processor", "require": { - "php": "^8.0", + "php": "^8.3|^8.4", "monolog/monolog": "^3.0" }, "require-dev": { "laravel/pint": "^1.15", - "phpunit/phpunit": "^10.0", + "phpunit/phpunit": "^10.0|^11.0", "squizlabs/php_codesniffer": "^2.8", "scrutinizer/ocular": "^1.9", "symfony/console": "^6.0" diff --git a/tests/MemoryUsageProcessorTest.php b/tests/MemoryUsageProcessorTest.php index 6824b05..e6847ba 100644 --- a/tests/MemoryUsageProcessorTest.php +++ b/tests/MemoryUsageProcessorTest.php @@ -25,7 +25,7 @@ protected function getRecord($level = Logger::WARNING, $message = 'test', $conte ); } - public function testProcessor() + public function test_processor() { $processor = new MemoryUsageProcessor; $record = $processor($this->getRecord()); @@ -35,7 +35,7 @@ public function testProcessor() $this->assertWithFormatting($record, 'memory_peak_usage'); } - public function testProcessorWithoutFormatting() + public function test_processor_without_formatting() { $processor = new MemoryUsageProcessor(false); $record = $processor($this->getRecord());