Thanks to visit codestin.com
Credit goes to github.com

Skip to content

yii2-framework/actions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yii Framework

Reusable GitHub Actions


A comprehensive collection of reusable GitHub Actions and workflows specifically designed for PHP projects. Streamline your CI/CD pipeline with battle-tested, configurable workflows for testing, static analysis, and code quality checks.

Features

Feature Overview

Available Workflows

Testing Workflows

Quality Assurance Workflows

Utility Actions

Quick start

Composer Require Checker

---
on:
  pull_request: &ignore-paths
    paths-ignore:
      - ".gitattributes"
      - ".gitignore"
      - "CHANGELOG.md"
      - "docs/**"
      - "README.md"

  push: *ignore-paths

name: composer-require-checker

jobs:
  dependency-check:
    uses: yii2-framework/actions/.github/workflows/composer-require-checker.yml@v1
    with:
      command-options: "--config-file=.composer-require-checker.json"

Easy Coding Standard

---
on:
  pull_request: &ignore-paths
    paths-ignore:
      - ".gitattributes"
      - ".gitignore"
      - "CHANGELOG.md"
      - "docs/**"
      - "README.md"

  push: *ignore-paths

name: easy-coding-standards

jobs:
  coding-standards:
    uses: yii2-framework/actions/.github/workflows/ecs.yml@v1
    with:
      command-options: "check --ansi --no-progress-bar"
      php-version: '["8.4"]'

Infection Mutation Testing {#infection}

---
on:
  pull_request: &ignore-paths
    paths-ignore:
      - ".gitattributes"
      - ".gitignore"
      - "CHANGELOG.md"
      - "docs/**"
      - "README.md"

  push: *ignore-paths

name: mutation-testing

jobs:
  mutation-testing:
    uses: yii2-framework/actions/.github/workflows/reusable-infection.yml@v2
    secrets:
      STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
    with:
      # Infection configuration
      command-options: "--threads=4 --min-msi=80"
      command-coverage-options: --with-uncovered
      # PHPStan integration
      phpstan: true

PHPUnit

---
on:
  pull_request: &ignore-paths
    paths-ignore:
      - ".gitattributes"
      - ".gitignore"
      - "CHANGELOG.md"
      - "docs/**"
      - "README.md"

  push: *ignore-paths

name: build

jobs:
  phpunit:
    uses: yii2-framework/actions/.github/workflows/phpunit.yml@v1
    secrets:
      AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
    with:
      # Composer settings
      composer-command: composer install --prefer-dist --no-progress
      # Coverage settings
      coverage-driver: pcov
      coverage-format: clover
      # PHP configuration
      extensions: mbstring, intl, pdo_sqlite
      ini-values: date.timezone='UTC', memory_limit=-1
      # Operating systems
      os: '["ubuntu-latest", "windows-2022"]'
      # PHP versions to test
      php-version: '["8.1", "8.2", "8.3", "8.4"]'
      # PHPUnit configuration
      phpunit-configuration: phpunit.xml
      phpunit-exclude-group: integration
      phpunit-group: unit

PHPUnit with Database

---
on:
  pull_request: &ignore-paths
    paths-ignore:
      - ".gitattributes"
      - ".gitignore"
      - "CHANGELOG.md"
      - "docs/**"
      - "README.md"

  push: *ignore-paths

name: build-mysql

jobs:
  database-tests:
    uses: yii2-framework/actions/.github/workflows/phpunit-database.yml@v1
    secrets:
      CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
    with:
      # Database configuration
      database-env: |
        {
          "MYSQL_ROOT_PASSWORD": "root",
          "MYSQL_DATABASE": "test"
        }
        database-health-cmd: "mysqladmin ping"
        database-health-retries: 3
        database-image: mysql
        database-port: 3306
        database-type: mysql
        database-versions: '["8.0", "8.4", "latest"]'
        extensions: pdo, pdo_mysql
        php-version: '["8.4"]'
        phpunit-group: mysql

Supported Databases:

Database Docker Image Default Port Health Check Command
MySQL mysql 3306 mysqladmin ping
PostgreSQL postgres 5432 pg_isready
SQL Server mcr.microsoft.com/mssql/server 1433 sqlcmd -Q "SELECT 1"
Oracle gvenzl/oracle-xe 1521 sqlplus -S / as sysdba

PHPStan Static Analysis

---
on:
  pull_request: &ignore-paths
    paths-ignore:
      - ".gitattributes"
      - ".gitignore"
      - "CHANGELOG.md"
      - "docs/**"
      - "README.md"

  push: *ignore-paths

name: static-analysis

jobs:
  static-analysis:
    uses: yii2-framework/actions/.github/workflows/phpstan.yml@v1
    with:
      # PHPStan configuration
      configuration: phpstan.neon
      command-options: "analyse --error-format=checkstyle | cs2pr"
      # Environment
      php-version: '["8.4"]'
      tools: cs2pr

Super Linter

---
on:
  - pull_request
  - push

name: linter

jobs:
  linter:
    uses: yii2-framework/actions/.github/workflows/super-linter.yml@main
    permissions:
      checks: write
      contents: read
      statuses: write    
    secrets:
      AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Note: YAML files should use 2-space indentation. This example shows correct YAML syntax - copy it to your .github/workflows/*.yml files as-is.

Package information

GitHub Release

Quality code

Super-Linter

Our social networks

Follow on X

License

License

About

Actions reusables.

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published