Automattic/php-push

View on GitHub
.github/workflows/CI.yml

Summary

Maintainability
Test Coverage
name: CI

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  Lint:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2

    - name: Validate composer.json and composer.lock
      run: composer validate

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

    - name: Lint
      run: composer lint

  Validate:
    runs-on: ubuntu-20.04
    steps:
    - uses: actions/checkout@v2
    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: '7.3'
        coverage: xdebug

    - name: Validate composer.json and composer.lock
      run: composer validate

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

    - name: Validate
      run: composer psalm

  build-and-test:
    name: Build and Test
    runs-on: ubuntu-20.04
    steps:
    - uses: actions/checkout@v2
    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: '7.3'

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

    - name: Set up Mock Server
      run: |
        node -v
        cd tests/MockAPNSServer 
        yarn setup
        yarn install
        yarn serve &
        cd -

    - name: Test and Upload Coverage
      uses: paambaati/codeclimate-action@v2.6.0
      env:
        CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
      with:
        coverageCommand: composer test
        debug: true
        coverageLocations: |
          ${{github.workspace}}/coverage/coverage.xml:clover