diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index b0951bb..0000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,363 +0,0 @@ -name: "build" - -on: - pull_request: - paths-ignore: - - "docs/**" - push: - branches: - - "main" - tags: - - v* - schedule: - - cron: "0 8 * * 1" # At 08:00 on Monday - -env: - extensions: "json, intl, :php-psr" - cache-version: "1" - composer-version: "v2" - composer-options: "--no-interaction --no-progress --prefer-dist --prefer-stable" - COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.ORGANIZATION_ACCESS_TOKEN }}"}}' - -jobs: - qa: - name: "Code quality assurance" - runs-on: "${{ matrix.operating-system }}" - - strategy: - fail-fast: false - matrix: - php-version: [ "8.2" ] - operating-system: [ "ubuntu-latest" ] - - steps: - - name: "Checkout" - uses: "actions/checkout@v4" - - - name: "Setup PHP cache environment" - id: "extcache" - uses: "shivammathur/cache-extensions@v1" - with: - php-version: "${{ matrix.php-version }}" - extensions: "${{ env.extensions }}" - key: "${{ env.cache-version }}" - - - name: "Cache PHP extensions" - uses: "actions/cache@v3" - with: - path: "${{ steps.extcache.outputs.dir }}" - key: "${{ steps.extcache.outputs.key }}" - restore-keys: "${{ steps.extcache.outputs.key }}" - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - php-version: "${{ matrix.php-version }}" - extensions: "${{ env.extensions }}" - tools: "composer:${{ env.composer-version }}, cs2pr" - coverage: "none" - - - name: "Setup problem matchers for PHP" - run: 'echo "::add-matcher::${{ runner.tool_cache }}/php.json"' - - - name: "Setup composer & install dependencies" - uses: "ramsey/composer-install@v2" - with: - dependency-versions: "highest" - composer-options: "${{ env.composer-options }}" - custom-cache-key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}" - - - name: "Coding Standard" - run: "make cs" - - static-analysis: - name: "Code static analysis" - runs-on: "${{ matrix.operating-system }}" - - strategy: - fail-fast: false - matrix: - php-version: [ "8.2" ] - operating-system: [ "ubuntu-latest" ] - - steps: - - name: "Checkout" - uses: "actions/checkout@v4" - - - name: "Setup PHP cache environment" - id: "extcache" - uses: "shivammathur/cache-extensions@v1" - with: - php-version: "${{ matrix.php-version }}" - extensions: "${{ env.extensions }}" - key: "${{ env.cache-version }}" - - - name: "Cache PHP extensions" - uses: "actions/cache@v3" - with: - path: "${{ steps.extcache.outputs.dir }}" - key: "${{ steps.extcache.outputs.key }}" - restore-keys: "${{ steps.extcache.outputs.key }}" - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - php-version: "${{ matrix.php-version }}" - extensions: "${{ env.extensions }}" - tools: "composer:${{ env.composer-version }}" - coverage: "none" - - - name: "Setup problem matchers for PHP" - run: 'echo "::add-matcher::${{ runner.tool_cache }}/php.json"' - - - name: "Setup composer & install dependencies" - uses: "ramsey/composer-install@v2" - with: - dependency-versions: "highest" - composer-options: "${{ env.composer-options }}" - custom-cache-key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}" - - - name: "PHPStan" - run: "make phpstan" - - tests: - name: "Code tests" - runs-on: "${{ matrix.operating-system }}" - needs: [ "qa", "static-analysis" ] - - strategy: - fail-fast: false - matrix: - php-version: [ "8.2" ] - operating-system: [ "ubuntu-latest" ] - - steps: - - name: "Checkout" - uses: "actions/checkout@v4" - - - name: "Setup PHP cache environment" - id: "extcache" - uses: "shivammathur/cache-extensions@v1" - with: - php-version: "${{ matrix.php-version }}" - extensions: "${{ env.extensions }}" - key: "${{ env.cache-version }}" - - - name: "Cache PHP extensions" - uses: "actions/cache@v3" - with: - path: "${{ steps.extcache.outputs.dir }}" - key: "${{ steps.extcache.outputs.key }}" - restore-keys: "${{ steps.extcache.outputs.key }}" - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - php-version: "${{ matrix.php-version }}" - extensions: "${{ env.extensions }}" - tools: "composer:${{ env.composer-version }}" - coverage: "none" - - - name: "Setup problem matchers for PHP" - run: 'echo "::add-matcher::${{ runner.tool_cache }}/php.json"' - - - name: "Setup composer & install dependencies" - uses: "ramsey/composer-install@v2" - with: - dependency-versions: "highest" - composer-options: "${{ env.composer-options }}" - custom-cache-key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}" - - - name: "Tests" - run: "make tests" - - - name: "Upload logs" - uses: "actions/upload-artifact@v3" - with: - name: "Logs - Tests (${{ matrix.operating-system }}, ${{ matrix.php-version }})" - path: "var/log" - if-no-files-found: "ignore" - - tests-code-coverage: - name: "Code tests with code coverage" - runs-on: "${{ matrix.operating-system }}" - needs: [ "tests" ] - - strategy: - matrix: - php-version: [ "8.2" ] - operating-system: [ "ubuntu-latest" ] - fail-fast: false - - if: "github.event_name == 'push'" - - steps: - - name: "Checkout" - uses: "actions/checkout@v4" - - - name: "Setup PHP cache environment" - id: "extcache" - uses: "shivammathur/cache-extensions@v1" - with: - php-version: "${{ matrix.php-version }}" - extensions: "${{ env.extensions }}" - key: "${{ env.cache-version }}" - - - name: "Cache PHP extensions" - uses: "actions/cache@v3" - with: - path: "${{ steps.extcache.outputs.dir }}" - key: "${{ steps.extcache.outputs.key }}" - restore-keys: "${{ steps.extcache.outputs.key }}" - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - php-version: "${{ matrix.php-version }}" - extensions: "${{ env.extensions }}" - tools: "composer:${{ env.composer-version }}" - coverage: "pcov" - - - name: "Setup problem matchers for PHP" - run: 'echo "::add-matcher::${{ runner.tool_cache }}/php.json"' - - - name: "Setup composer & install dependencies" - uses: "ramsey/composer-install@v2" - with: - dependency-versions: "highest" - composer-options: "${{ env.composer-options }}" - custom-cache-key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}" - - - name: "Tests" - run: "make coverage-clover" - - - name: "Coveralls.io" - env: - CI_NAME: github - CI: true - COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.5.3/php-coveralls.phar - php php-coveralls.phar --verbose --config tools/.coveralls.yml - - tests-mutations: - name: "Test for mutants" - runs-on: "${{ matrix.operating-system }}" - - strategy: - matrix: - php-version: [ "8.2" ] - operating-system: [ "ubuntu-latest" ] - fail-fast: false - - if: "github.event_name == 'push'" - - steps: - - name: "Checkout" - uses: "actions/checkout@v4" - - - name: "Setup PHP cache environment" - id: "extcache" - uses: "shivammathur/cache-extensions@v1" - with: - php-version: "${{ matrix.php-version }}" - extensions: "${{ env.extensions }}" - key: "${{ env.cache-version }}" - - - name: "Cache PHP extensions" - uses: "actions/cache@v3" - with: - path: "${{ steps.extcache.outputs.dir }}" - key: "${{ steps.extcache.outputs.key }}" - restore-keys: "${{ steps.extcache.outputs.key }}" - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - php-version: "${{ matrix.php-version }}" - extensions: "${{ env.extensions }}" - tools: "composer:${{ env.composer-version }}" - coverage: "pcov" - - - name: "Setup problem matchers for PHP" - run: 'echo "::add-matcher::${{ runner.tool_cache }}/php.json"' - - - name: "Setup composer & install dependencies" - uses: "ramsey/composer-install@v2" - with: - dependency-versions: "highest" - composer-options: "${{ env.composer-options }}" - custom-cache-key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}" - - - name: "Mutation tests" - run: "make mutations-tests" - - - name: "Cache Infection data" - uses: "actions/cache@v3" - with: - path: "var/tools/Infection" - key: "php-infection-${{ runner.os }}" - restore-keys: "php-infection-${{ runner.os }}" - - - name: "Mutation tests with report" - env: - STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }} - shell: "bash" - run: "make mutations-infection ARGS='--logger-github'" - - - name: "Upload logs" - uses: "actions/upload-artifact@v3" - with: - name: "Logs - Mutations" - path: "var/coverage/mutations/infection.log" - if-no-files-found: "ignore" - - lint: - name: "Code linting" - runs-on: "${{ matrix.operating-system }}" - - strategy: - matrix: - php-version: [ "8.2" ] - operating-system: [ "ubuntu-latest" ] - fail-fast: false - - steps: - - name: "Checkout" - uses: "actions/checkout@v4" - - - name: "Setup PHP cache environment" - id: "extcache" - uses: "shivammathur/cache-extensions@v1" - with: - php-version: "${{ matrix.php-version }}" - extensions: "${{ env.extensions }}" - key: "${{ env.cache-version }}" - - - name: "Cache PHP extensions" - uses: "actions/cache@v3" - with: - path: "${{ steps.extcache.outputs.dir }}" - key: "${{ steps.extcache.outputs.key }}" - restore-keys: "${{ steps.extcache.outputs.key }}" - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - php-version: "${{ matrix.php-version }}" - extensions: "${{ env.extensions }}" - tools: "composer:${{ env.composer-version }}" - coverage: "none" - - - name: "Setup problem matchers for PHP" - run: 'echo "::add-matcher::${{ runner.tool_cache }}/php.json"' - - - name: "Setup composer & install dependencies" - uses: "ramsey/composer-install@v2" - with: - dependency-versions: "highest" - composer-options: "${{ env.composer-options }}" - custom-cache-key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}" - - - name: "Check php linter" - run: "make lint" diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..cd3fef8 --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,31 @@ +name: "Code Linting" + +on: + pull_request: + paths-ignore: + - "docs/**" + push: + branches: + - "main" + tags: + - v* + schedule: + - cron: "0 8 * * 1" # At 08:00 on Monday + +env: + COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.ORGANIZATION_ACCESS_TOKEN }}"}}' + +jobs: + php: + name: "PHP Lint" + + uses: "fastybird/.github/.github/workflows/php-lint.yaml@main" + secrets: inherit + with: + php: "${{ matrix.php-version }}" + + strategy: + fail-fast: false + matrix: + php-version: [ "8.2" ] + operating-system: [ "ubuntu-latest" ] diff --git a/.github/workflows/qa.yaml b/.github/workflows/qa.yaml new file mode 100644 index 0000000..c3b2e0e --- /dev/null +++ b/.github/workflows/qa.yaml @@ -0,0 +1,31 @@ +name: "Code quality assurance" + +on: + pull_request: + paths-ignore: + - "docs/**" + push: + branches: + - "main" + tags: + - v* + schedule: + - cron: "0 8 * * 1" # At 08:00 on Monday + +env: + COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.ORGANIZATION_ACCESS_TOKEN }}"}}' + +jobs: + php: + name: "PHP Code quality assurance" + + uses: "fastybird/.github/.github/workflows/php-cs.yaml@main" + secrets: inherit + with: + php: "${{ matrix.php-version }}" + + strategy: + fail-fast: false + matrix: + php-version: [ "8.2" ] + operating-system: [ "ubuntu-latest" ] diff --git a/.github/workflows/static-analysis.yaml b/.github/workflows/static-analysis.yaml new file mode 100644 index 0000000..d1e02d6 --- /dev/null +++ b/.github/workflows/static-analysis.yaml @@ -0,0 +1,31 @@ +name: "Code Static Analysis" + +on: + pull_request: + paths-ignore: + - "docs/**" + push: + branches: + - "main" + tags: + - v* + schedule: + - cron: "0 8 * * 1" # At 08:00 on Monday + +env: + COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.ORGANIZATION_ACCESS_TOKEN }}"}}' + +jobs: + phpstan: + name: "PHP Lint" + + uses: "fastybird/.github/.github/workflows/phpstan.yaml@main" + secrets: inherit + with: + php: "${{ matrix.php-version }}" + + strategy: + fail-fast: false + matrix: + php-version: [ "8.2" ] + operating-system: [ "ubuntu-latest" ] diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..7ffd98f --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,66 @@ +name: "PHP Tester" + +on: + pull_request: + paths-ignore: + - "docs/**" + push: + branches: + - "main" + tags: + - v* + schedule: + - cron: "0 8 * * 1" # At 08:00 on Monday + +env: + COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.ORGANIZATION_ACCESS_TOKEN }}"}}' + +jobs: + tests: + name: "PHP Tests" + + uses: "fastybird/.github/.github/workflows/phpunit.yaml@main" + secrets: inherit + with: + php: "${{ matrix.php-version }}" + + strategy: + fail-fast: false + matrix: + php-version: [ "8.2" ] + operating-system: [ "ubuntu-latest" ] + + code-coverage: + name: "PHP Tests With Code Coverage" + needs: [ "tests" ] + + if: "github.event_name == 'push'" + + uses: "fastybird/.github/.github/workflows/phpunit.yaml@main" + secrets: inherit + with: + php: "${{ matrix.php-version }}" + coverage: true + + strategy: + fail-fast: false + matrix: + php-version: [ "8.2" ] + operating-system: [ "ubuntu-latest" ] + + mutations: + name: "PHP Tests For Mutants" + needs: [ "tests" ] + + if: "github.event_name == 'push'" + + uses: "fastybird/.github/.github/workflows/mutations.yaml@main" + secrets: inherit + with: + php: "${{ matrix.php-version }}" + + strategy: + fail-fast: false + matrix: + php-version: [ "8.2" ] + operating-system: [ "ubuntu-latest" ]