From 31bdeaa8f10b1dbe641adeb54ece94cc1af95999 Mon Sep 17 00:00:00 2001 From: Timo Michna Date: Sat, 18 Jun 2022 01:15:59 +0200 Subject: [PATCH] Add package validate call to CI (#714) * Add package validate call * Fix WF * Touch composer.json to burst cache * Fix job name * Add PHP version to Psalm call * Make package job depend on php job * Fix base TestCase * Add install directory * Touch composer.json to burst cache * Add install directory * Fix install directory * Temporarily remove job dependency * Touch composer.json to bust cache * Touch composer.json to bust cache * Touch composer.json to bust cache * Touch composer.json to bust cache * Fix extensions * Make package job depend on QA job * Use PHP QA in CI badge --- .github/workflows/php.yml | 18 ++++++++++-------- README.md | 2 +- composer.json | 3 ++- .../SpanProcessor/MultiSpanProcessorTest.php | 4 ++-- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 1256c878c..8aa513651 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -1,5 +1,4 @@ - -name: PHP Composer +name: PHP QA on: push: @@ -8,8 +7,7 @@ on: branches: [ main ] jobs: - build: - + php: runs-on: ${{ matrix.os }} continue-on-error: ${{ matrix.experimental }} strategy: @@ -47,9 +45,6 @@ jobs: if: steps.composer-cache.outputs.cache-hit != 'true' run: composer install --prefer-dist --no-progress --no-suggest - - name: Validate packages composer.json - run: vendor/bin/otel packages:composer:validate - - name: Check Style run: vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --dry-run --stop-on-violation --using-cache=no -vvv @@ -62,7 +57,7 @@ jobs: run: vendor/bin/phan - name: Run Psalm - run: vendor/bin/psalm --output-format=github + run: vendor/bin/psalm --output-format=github --php-version=${{ matrix.php-version }} - name: Run Phpstan run: vendor/bin/phpstan analyse --error-format=github @@ -75,3 +70,10 @@ jobs: - name: Code Coverage run: bash <(curl -s https://codecov.io/bash) -F ${{ matrix.php-version }} + + packages: + uses: opentelemetry-php/gh-workflows/.github/workflows/validate-packages.yml@main + needs: php + with: + matrix_extension: '["ast, json, grpc"]' + install_directory: '~/.test/.packages' diff --git a/README.md b/README.md index 66987644a..bbdac01d8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # OpenTelemetry php library -![CI Build](https://github.com/open-telemetry/opentelemetry-php/workflows/PHP%20Composer/badge.svg) +![CI Build](https://github.com/open-telemetry/opentelemetry-php/workflows/PHP%20QA/badge.svg) [![codecov](https://codecov.io/gh/open-telemetry/opentelemetry-php/branch/master/graph/badge.svg)](https://codecov.io/gh/open-telemetry/opentelemetry-php) ## Current Project Status diff --git a/composer.json b/composer.json index 21376c4e8..95684493c 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,7 @@ { "name": "open-telemetry/opentelemetry", "description": "OpenTelemetry makes robust, portable telemetry a built-in feature of cloud-native software.", + "keywords": ["opentelemetry", "otel", "open-telemetry", "tracing", "logging", "metrics"], "type": "library", "homepage": "https://opentelemetry.io/docs/php", "readme": "./README.md", @@ -68,7 +69,7 @@ }, "require-dev": { "ext-grpc": "*", - "assertwell/phpunit-global-state": "^0.2", + "assertwell/phpunit-global-state": "^0.2.1", "composer/xdebug-handler": "^2.0", "dg/bypass-finals": "^1.3", "friendsofphp/php-cs-fixer": "^3.4", diff --git a/tests/Unit/SDK/Trace/SpanProcessor/MultiSpanProcessorTest.php b/tests/Unit/SDK/Trace/SpanProcessor/MultiSpanProcessorTest.php index 25e9c78c5..d3633202e 100644 --- a/tests/Unit/SDK/Trace/SpanProcessor/MultiSpanProcessorTest.php +++ b/tests/Unit/SDK/Trace/SpanProcessor/MultiSpanProcessorTest.php @@ -4,15 +4,15 @@ namespace OpenTelemetry\Tests\Unit\SDK\Trace\SpanProcessor; -use Monolog\Test\TestCase; use OpenTelemetry\SDK\Trace\ReadableSpanInterface; use OpenTelemetry\SDK\Trace\ReadWriteSpanInterface; use OpenTelemetry\SDK\Trace\SpanProcessor\MultiSpanProcessor; use OpenTelemetry\SDK\Trace\SpanProcessorInterface; use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; /** - * @covers OpenTelemetry\SDK\Trace\SpanProcessor\MultiSpanProcessor + * @covers \OpenTelemetry\SDK\Trace\SpanProcessor\MultiSpanProcessor */ class MultiSpanProcessorTest extends TestCase {