Skip to content

PDepend

PDepend #60

Workflow file for this run

# This file is part of the sshilko/php-api-myrpc package.
#
# (c) Sergei Shilko <[email protected]>
#
# MIT License
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
# @license https://opensource.org/licenses/mit-license.php MIT
name: PDepend
on:
workflow_run:
workflows: [ "Docker" ]
types:
- completed
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip-ci')"
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- name: Load cached app docker image
id: docker-php-image-cache
uses: actions/cache@v3
with:
path: /tmp/docker-save
key: ${{ runner.os }}-docker-php-build-save-${{ hashFiles('build/Dockerfile.php.common', 'build/dockerfile.php81') }}
- name: Load cached Docker image
run: docker load -i /tmp/docker-save/snapshot.tar && docker tag app/php-image-cache app/php
- name: Docker boot
env:
DOCKER_BUILDKIT: '1'
COMPOSE_DOCKER_CLI_BUILD: '1'
SERVICES_NAME: "app.php"
run: docker-compose up -d $SERVICES_NAME
- run: docker-compose ps
- name: Sleep
run: sleep 6
timeout-minutes: 1
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('composer.lock') }}-composer-dev
- name: Docker install dependencies
run: docker-compose exec -T app.php composer install
# Docs: https://phpunit.readthedocs.io/en/9.5/
- name: Docker run PHPUnit
run: docker-compose exec -T app.php composer app-pdepend
# https://github.com/actions/upload-artifact
- name: Upload Pdepend artifacts
uses: actions/upload-artifact@v3
with:
name: pdepend-output
path: |
build/tmp/pdepend-dependency-xml.xml
build/tmp/pdepend-jdepend-chart.svg
build/tmp/pdepend-jdepend-xml.xml
build/tmp/pdepend-summary-xml.xml
build/tmp/pdepend-overview-pyramid.svg
retention-days: 1
badges:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 2
permissions: write-all
steps:
# https://github.com/actions/checkout
- name: Checkout pages branch
uses: actions/checkout@v3
with:
ref: pages
# https://github.com/marketplace/actions/download-a-build-artifact
- name: Download all PHPUnit artifacts
uses: actions/download-artifact@v3
with:
name: pdepend-output
path: php/pdepend
- uses: nick-fields/retry@v2
name: Commit pdepend details
continue-on-error: true
with:
timeout_seconds: 20
max_attempts: 3
retry_on: error
command: |
git status
git config user.name github-actions
git config user.email [email protected]
git pull
git add php/pdepend/*
git commit -m "generated pdepend artifacts from revision ${GITHUB_SHA::7}"
git push