ohseesoftware/oh-see-gists

View on GitHub
.github/workflows/Build.yaml

Summary

Maintainability
Test Coverage
name: Build
on: [push, pull_request]
jobs:
  test:
    name: Test
    runs-on: ubuntu-18.04
    steps:
      - uses: actions/checkout@master
      - name: Checkout
        if: github.ref == 'refs/heads/master'
        run: git checkout "${GITHUB_REF:11}"
      - name: Setup PHP with PECL extension
        uses: shivammathur/setup-php@v2
        with:
          php-version: '7.4'
      - name: Composer Install
        run: composer install
      - name: PHPCS
        run: ./vendor/bin/phpcs src
      - name: Run Tests
        run: ./vendor/bin/phpunit
      - name: Coveralls
        if: github.ref == 'refs/heads/master'
        run: ./vendor/bin/php-coveralls -v --coverage_clover build/coverage.xml --json_path build/coveralls-upload.json
        env:
          COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  release:
    name: Release
    if: github.ref == 'refs/heads/master'
    needs: test
    runs-on: ubuntu-18.04
    steps:
      - name: Checkout
        uses: actions/checkout@v1
      - name: Setup Node.js
        uses: actions/setup-node@v1
        with:
          node-version: 12
      - name: Install dependencies
        run: yarn install
      - name: Release
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: npx semantic-release@17