on: ["push", "pull_request"]
name: Main Workflow

jobs:
  run:
    name: Run
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2

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

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

      - name: Run test suite
        run: vendor/bin/phpunit --testsuite=unit

      - name: Run PHP Code Sniffer
        run: vendor/bin/phpcs

      - name: Make sure project files are compilable
        run: find -L . -path ./vendor -prune -o -path ./tests -prune -o -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l

      - name: SonarCloud integration
        uses: sonarsource/sonarcloud-github-action@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

Create a GitHub Actions workflow
Create a GitHub Actions workflow