warlof/seat-discord-connector

View on GitHub
.github/workflows/main.yml

Summary

Maintainability
Test Coverage
name: tests

on:
  push:
    branches: [ 5.0.x ]
  pull_request:
    branches: [ 5.0.x ]

jobs:
  code-climate:
    runs-on: ubuntu-latest
    name: Code Climate Tests Coverage
    steps:
      - name: Checkout code
        uses: actions/checkout@v3

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: '7.4'
          coverage: xdebug
          extensions: bz2, curl, dom, gd, gmp, intl, igbinary, json, mbstring, opcache, redis, tokenizer, sqlite3, zip, xdebug
          tools: composer:v2

      - name: Download Code Climate Reporter
        run: |
          wget https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
          chmod +x test-reporter-latest-linux-amd64

      - name: Update dependencies
        run: composer update --prefer-source

      - name: Prepare Reporter
        run: ./test-reporter-latest-linux-amd64 before-build

      - name: Run Tests
        run: ./vendor/bin/phpunit

      - name: Send report to Code Climate
        run: ./test-reporter-latest-linux-amd64 after-build -t clover -r ${{ secrets.CC_REPORTER_ID }}
  codacy:
    runs-on: ubuntu-latest
    name: Codacy Tests Coverage
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: '7.4'
          coverage: xdebug
          extensions: bz2, curl, dom, gd, gmp, intl, igbinary, json, mbstring, opcache, redis, tokenizer, sqlite3, zip, xdebug
          tools: composer:v2

      - name: Update dependencies
        run: composer update

      - name: Run Unit Tests
        run: ./vendor/bin/phpunit

      - name: Run codacy-coverage-reporter
        uses: codacy/codacy-coverage-reporter-action@master
        with:
          project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}