From 1dfd6924b2b1355475f0a5c529ff274ec3a108dc Mon Sep 17 00:00:00 2001 From: webeweb Date: Wed, 3 Feb 2021 12:32:49 +0100 Subject: [PATCH] Split GitHub workflows configuration --- .github/workflows/analysis.yml | 36 ++++++++++++++++ .github/workflows/build.yml | 76 ---------------------------------- .github/workflows/metrics.yml | 50 ++++++++++++++++++++++ 3 files changed, 86 insertions(+), 76 deletions(-) create mode 100644 .github/workflows/analysis.yml create mode 100644 .github/workflows/metrics.yml diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml new file mode 100644 index 0000000..eb5f8d7 --- /dev/null +++ b/.github/workflows/analysis.yml @@ -0,0 +1,36 @@ +# .github/workflows/analysis.yml +name: "analysis" + +on: [ push, release, pull_request ] + +jobs: + + build: + name: "PHPStan" + runs-on: ubuntu-18.04 + + steps: + - name: "Checkout" + uses: actions/checkout@v2 + + - name: "Build environment" + uses: shivammathur/setup-php@v2 + with: + php-version: "7.1" + coverage: "xdebug" + + - name: "Dependencies" + run: | + php --version + composer --version + COMPOSER_MEMORY_LIMIT=-1 composer update + + - name: "Application" + run: | + mkdir -p build/logs + wget -c -nc --retry-connrefused --tries=0 https://github.com/phpstan/phpstan/releases/download/0.12.71/phpstan.phar -O phpstan.phar + chmod +x phpstan.phar + php phpstan.phar --version + + - name: "Analyses" + run: php phpstan.phar analyse src/ --error-format=github diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9e31490..824edfb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,79 +62,3 @@ jobs: with: github-token: ${{ secrets.github_token }} parallel-finished: true - - analysis: - name: "Analysis" - runs-on: ubuntu-18.04 - needs: "build" - - steps: - - name: "Checkout" - uses: actions/checkout@v2 - - - name: "Build environment" - uses: shivammathur/setup-php@v2 - with: - php-version: "7.1" - coverage: "xdebug" - - - name: "Dependencies" - run: | - php --version - composer --version - COMPOSER_MEMORY_LIMIT=-1 composer update - - - name: "Application" - run: | - mkdir -p build/logs - wget -c -nc --retry-connrefused --tries=0 https://github.com/phpstan/phpstan/releases/download/0.12.71/phpstan.phar -O phpstan.phar - chmod +x phpstan.phar - php phpstan.phar --version - - - name: "Analyses" - run: php phpstan.phar analyse src/ --error-format=github - - metrics: - name: "Metrics" - runs-on: ubuntu-18.04 - needs: "build" - - steps: - - name: "Checkout" - uses: actions/checkout@v2 - - - name: "Build environment" - uses: shivammathur/setup-php@v2 - with: - php-version: "7.1" - coverage: "xdebug" - - - name: "Dependencies" - run: | - php --version - composer --version - COMPOSER_MEMORY_LIMIT=-1 composer update - - - name: "Application" - run: | - mkdir -p build/logs - wget -c -nc --retry-connrefused --tries=0 https://github.com/phpmetrics/PhpMetrics/releases/download/v2.7.3/phpmetrics.phar -O phpmetrics.phar - chmod +x phpmetrics.phar - php phpmetrics.phar --version - - - name: "Tests" - run: vendor/bin/phpunit --log-junit build/logs/junit.xml - - - name: "Calculates" - run: php phpmetrics.phar --git --junit=build/logs/junit.xml --report-html=build/logs/ src/ - - - name: "Compress artifact" - run: | - cd build/logs - zip -r ../report.zip * -x junit.xml - - - name: "Upload artifact" - uses: actions/upload-artifact@v2 - with: - name: "metrics.zip" - path: build/report.zip diff --git a/.github/workflows/metrics.yml b/.github/workflows/metrics.yml new file mode 100644 index 0000000..d12d300 --- /dev/null +++ b/.github/workflows/metrics.yml @@ -0,0 +1,50 @@ +# .github/workflows/metrics.yml +name: "metrics" + +on: [ push, release, pull_request ] + +jobs: + + build: + name: "PHP Metrics" + runs-on: ubuntu-18.04 + + steps: + - name: "Checkout" + uses: actions/checkout@v2 + + - name: "Build environment" + uses: shivammathur/setup-php@v2 + with: + php-version: "7.1" + coverage: "xdebug" + + - name: "Dependencies" + run: | + php --version + composer --version + COMPOSER_MEMORY_LIMIT=-1 composer update + + - name: "Application" + run: | + mkdir -p build/logs + wget -c -nc --retry-connrefused --tries=0 https://github.com/phpmetrics/PhpMetrics/releases/download/v2.7.3/phpmetrics.phar -O phpmetrics.phar + chmod +x phpmetrics.phar + php phpmetrics.phar --version + + - name: "Tests" + run: vendor/bin/phpunit --log-junit build/logs/junit.xml + + - name: "Calculates" + run: php phpmetrics.phar --git --junit=build/logs/junit.xml --report-html=build/logs/ src/ + + - name: "Compress artifact" + run: | + cd build/logs + zip -r ../report.zip * -x junit.xml + + - name: "Upload artifact" + uses: actions/upload-artifact@v2 + with: + name: "metrics" + path: build/report.zip