From 7bd45e0f1c8cc3fc042b7d37806de41df245d079 Mon Sep 17 00:00:00 2001 From: "Oliver G. Mueller" Date: Tue, 19 Mar 2024 16:43:27 +0100 Subject: [PATCH] added more actions --- .github/workflows/ci.yml | 80 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d1607b8..6d392a1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -183,6 +183,86 @@ jobs: - name: "Run friendsofphp/php-cs-fixer" run: "vendor/bin/php-cs-fixer fix --ansi --config=.php-cs-fixer.php --diff --dry-run --show-progress=dots --verbose" + dependency-analysis: + name: "Dependency Analysis" + runs-on: "ubuntu-latest" + timeout-minutes: 5 + + strategy: + matrix: + php-version: ["8.3"] + composer-param: ["update --no-progress --prefer-dist"] + experimental: [false] + + steps: + - name: "Checkout" + uses: "actions/checkout@v4" + + - name: "Lint YAML files" + uses: "ibiqlik/action-yamllint@v3" + with: + config_file: ".yamllint.yaml" + file_or_dir: "." + strict: true + + - name: "Setup PHP" + uses: "shivammathur/setup-php@v2" + with: + php-version: "${{ matrix.php-version }}" + tools: "composer:v2" + coverage: "none" + + - name: "Set up problem matchers for PHP" + run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\"" + + - name: "Get composer cache directory" + id: "composer-cache" + run: "echo \"dir=$(composer config cache-dir)\" >> $GITHUB_OUTPUT" + continue-on-error: "${{ matrix.experimental }}" + + - name: "Cache composer dependencies" + uses: "actions/cache@v4" + with: + path: "${{ steps.composer-cache.outputs.dir }}" + key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}" + restore-keys: "${{ runner.os }}-composer-" + continue-on-error: "${{ matrix.experimental }}" + + - name: "Install dependencies" + run: "composer ${{ matrix.composer-param }}" + continue-on-error: "${{ matrix.experimental }}" + + - name: "Cache directory for rector/rector" + uses: "actions/cache@v4" + with: + path: ".build/rector" + key: "php-${{ matrix.php-version }}-rector-${{ github.ref_name }}" + restore-keys: | + php-${{ matrix.php-version }}-rector-main + php-${{ matrix.php-version }}-rector- + + + - name: "Create phive home directory" + run: "mkdir -p .build/phive" + shell: "bash" + + - name: "Cache dependencies installed with phive" + uses: "actions/cache@v4.0.1" + with: + path: ".build/phive" + key: "phive-hashFiles('**/phars.xml')" + restore-keys: "phive-" + + - name: "Install dependencies with phive" + env: + PHIVE_HOME: ".build/phive" + run: "phive install --trust-gpg-keys 0x2DF45277AEF09A2F,0x033E5F8D801A2F8D,0x033E5F8D801A2F8D" + shell: "bash" + + + - name: "Run maglnet/composer-require-checker" + run: ".phive/composer-require-checker check --ansi --config-file=$(pwd)/composer-require-checker.json --verbose" + refactoring: name: "Refactoring" runs-on: "ubuntu-latest"