diff --git a/.github/workflows/ci.yml.dist b/.github/workflows/ci.yml.dist deleted file mode 100644 index f2038016..00000000 --- a/.github/workflows/ci.yml.dist +++ /dev/null @@ -1,78 +0,0 @@ ---- - -on: # yamllint disable-line rule:truthy - push: - branches: - - master - pull_request: - branches: - - master - -name: ๐Ÿ” Continuous integration - -jobs: - integration: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: true - matrix: - os: ["ubuntu-22.04"] - php: ["8.2"] - steps: - - name: ๐Ÿ“ฆ Check out the codebase - uses: actions/checkout@v4 - - - name: ๐Ÿ› ๏ธ Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: mbstring, fileinfo, pdo_mysql, pdo - ini-values: error_reporting=E_ALL - tools: composer:v2, pecl - coverage: xdebug - - - name: ๐Ÿ› ๏ธ Setup problem matchers - run: | - echo "::add-matcher::${{ runner.tool_cache }}/php.json" - echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - - name: โ™ป๏ธ Restore cached dependencies - id: cached-composer-dependencies - uses: actions/cache@v4 - with: - path: vendor - key: vendor-${{ runner.os }}-${{ hashFiles('**/composer.lock') }}-${{ matrix.php }} - - - name: ๐Ÿ“ฅ Install dependencies - if: steps.cached-composer-dependencies.outputs.cache-hit != 'true' - run: composer install - - - name: ๐Ÿ› ๏ธ Prepare environment - run: | - mkdir -p ./.build/php-cs-fixer - mkdir -p ./.build/phpstan - mkdir -p ./.build/phpunit - - - name: ๐Ÿšจ Run coding standards task - run: composer cs:diff - env: - PHP_CS_FIXER_IGNORE_ENV: true - - - name: ๐Ÿงช Execute phpunit and pest tests - env: - XDEBUG_MODE: coverage - DB_CONNECTION: sqlite - DB_DATABASE: ":memory:" - run: vendor/bin/pest --coverage-clover=coverage.xml - - - name: ๐Ÿ” Run static analysis using phpstan - run: composer stan:ci - - - name: ๐Ÿ“ค Upload coverage report to Codecov - uses: codecov/codecov-action@v4.4.0 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./coverage.xml - verbose: true - -... diff --git a/.github/workflows/dependency-analysis.yml b/.github/workflows/dependency-analysis.yml new file mode 100644 index 00000000..a69bda3c --- /dev/null +++ b/.github/workflows/dependency-analysis.yml @@ -0,0 +1,87 @@ +--- + +name: ๐Ÿ” Dependency analysis + +on: # yamllint disable-line rule:truthy + push: + branches: + - master + paths: + - 'config/**' + - 'src/**' + - 'tests/**' + - '.php-cs-fixer.dist.php' + - 'composer.json' + - 'composer.lock' + - 'composer-require-checker.json' + pull_request: + branches: + - master + paths: + - 'config/**' + - 'src/**' + - 'tests/**' + - '.php-cs-fixer.dist.php' + - 'composer.json' + - 'composer.lock' + - 'composer-require-checker.json' + +jobs: + dependency-analysis: + timeout-minutes: 4 + runs-on: ${{ matrix.os }} + concurrency: + cancel-in-progress: true + group: dependency-analysis-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + strategy: + fail-fast: true + matrix: + os: + - ubuntu-latest + php-version: + - '8.2' + dependencies: + - locked + + steps: + - name: ๐Ÿ“ฆ Check out the codebase + uses: actions/checkout@v4.1.6 + + - name: ๐Ÿ› ๏ธ Setup PHP + uses: shivammathur/setup-php@2.30.4 + with: + php-version: ${{ matrix.php-version }} + extensions: none, ctype, dom, json, mbstring, simplexml, tokenizer, xml, xmlwriter, pdo, curl, fileinfo, pdo_mysql + ini-values: error_reporting=E_ALL + coverage: none + tools: phive + + - name: ๐Ÿ› ๏ธ Setup problem matchers + run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" + + - name: ๐Ÿค– Validate composer.json and composer.lock + run: composer validate --ansi --strict + + - name: ๐Ÿ” Get composer cache directory + uses: wayofdev/gh-actions/actions/composer/get-cache-directory@v3.1.0 + + - name: โ™ป๏ธ Restore cached dependencies installed with composer + uses: actions/cache@v4.0.2 + with: + path: ${{ env.COMPOSER_CACHE_DIR }} + key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }} + restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}- + + - name: ๐Ÿ“ฅ Install "${{ matrix.dependencies }}" dependencies + uses: wayofdev/gh-actions/actions/composer/install@v3.1.0 + with: + dependencies: ${{ matrix.dependencies }} + + - name: ๐Ÿ“ฅ Install dependencies with phive + uses: wayofdev/gh-actions/actions/phive/install@v3.1.0 + with: + phive-home: '.phive' + trust-gpg-keys: 0xC00543248C87FB13,0x033E5F8D801A2F8D + + - name: ๐Ÿ”ฌ Run maglnet/composer-require-checker + run: .phive/composer-require-checker check --ansi --config-file="$(pwd)/composer-require-checker.json" --verbose diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index e905a4ba..8411390c 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -9,6 +9,12 @@ on: # yamllint disable-line rule:truthy - 'src/**' - 'tests/**' - '.php-cs-fixer.dist.php' + - 'composer.json' + - 'composer.lock' + - 'phpstan.neon.dist' + - 'phpstan-baseline.neon' + - 'psalm.xml' + - 'psalm-baseline.xml' pull_request: branches: - master @@ -17,6 +23,12 @@ on: # yamllint disable-line rule:truthy - 'src/**' - 'tests/**' - '.php-cs-fixer.dist.php' + - 'composer.json' + - 'composer.lock' + - 'phpstan.neon.dist' + - 'phpstan-baseline.neon' + - 'psalm.xml' + - 'psalm-baseline.xml' name: ๐Ÿ” Static analysis