arifszn/php-blog-client

View on GitHub
.github/workflows/ci.yml

Summary

Maintainability
Test Coverage
name: 'Test'

on:
  push:
    branches: [main]

  pull_request:
    branches: [main]

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        php: ['8.1']

    steps:
      - name: Checkout repository
        uses: actions/checkout@v3

      - name: Setup PHP ${{ matrix.php }}
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php }}

      - name: Install composer dependencies
        run: composer install --no-progress --prefer-dist --optimize-autoloader

      - name: Run code sniffer
        run: composer cs

      - name: Run tests
        run: composer test

      - name: Publish in Code Climate
        uses: paambaati/codeclimate-action@v3.0.0
        env:
          CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
        with:
          coverageCommand: composer test:coverage