Skip to content

Commit

Permalink
Split GitHub workflows configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
webeweb committed Feb 3, 2021
1 parent e9e737a commit 9c63623
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 76 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
@@ -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
76 changes: 0 additions & 76 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
50 changes: 50 additions & 0 deletions .github/workflows/metrics.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9c63623

Please sign in to comment.