image: moh8med/php-8.1-testing-alpine
pipelines:
  default:
    - parallel:
        steps:
          - step:
              name: Lint
              script:
                - ~/.composer/vendor/bin/phplint ./ --exclude=vendor
          # - step:
          #     name: Coding Standard (PSR-12)
          #     script:
          #       - ~/.composer/vendor/bin/phpcs --standard=PSR12 -n app/ config/ database/
          - step:
              name: Security Check
              script:
                - ~/.composer/vendor/bin/security-checker security:check
          - step:
              name: Build and Test
              caches:
                - composer
              artifacts:
                - vendor/**
              script:
                - php -r "file_exists('.env') || copy('.env.example', '.env');"
                - composer install --no-progress --no-suggest --prefer-dist --no-interaction
                - php artisan key:generate
                - php artisan test
                # - php artisan test --coverage
                # - vendor/bin/phpstan analyse --memory-limit=512M