diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index a68144e..16e655f 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -1,34 +1,37 @@ name: Integration Tests -on: [push, pull_request] +on: + pull_request: + branches: [main] + workflow_dispatch: jobs: - test: - runs-on: ubuntu-latest + test: + runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 + steps: + - name: Checkout code + uses: actions/checkout@v4 - - name: Set up PHP - uses: shivammathur/setup-php@v2 - with: - php-version: "8.4" + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "8.4" - - name: Install dependencies - run: composer install + - name: Install dependencies + run: composer install - - name: Set up Docker Compose - uses: docker/setup-compose-action@v1 + - name: Set up Docker Compose + uses: docker/setup-compose-action@v1 - - name: Prepare data directory with correct permissions - run: | - mkdir -p ./tests/.litebase - chmod 777 ./tests/.litebase + - name: Prepare data directory with correct permissions + run: | + mkdir -p ./tests/.litebase + chmod 777 ./tests/.litebase - - name: Run integration tests - run: vendor/bin/pest tests/Integration + - name: Run integration tests + run: vendor/bin/pest tests/Integration - - name: Report results - if: always() - run: echo "Integration tests completed." + - name: Report results + if: always() + run: echo "Integration tests completed." diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml new file mode 100644 index 0000000..02ac240 --- /dev/null +++ b/.github/workflows/phpstan.yml @@ -0,0 +1,26 @@ +name: phpstan + +on: + pull_request: + branches: [main] + workflow_dispatch: + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "8.4" + tools: composer:v2 + + - name: Install Dependencies + run: composer install --no-interaction --prefer-dist --optimize-autoloader + + - name: Run PHPStan + run: composer run phpstan diff --git a/composer.json b/composer.json index 11a99c9..8969c1c 100644 --- a/composer.json +++ b/composer.json @@ -48,6 +48,7 @@ }, "scripts": { "generate_open_api": "openapi-generator-cli generate -c openapi_config.yaml", + "phpstan": "vendor/bin/phpstan analyse -c phpstan.neon --memory-limit=512M src tests", "pint": "vendor/bin/pint --no-interaction", "test": "vendor/bin/pest", "test-coverage": "vendor/bin/pest --coverage-html coverage" diff --git a/phpstan.neon b/phpstan.neon index 79989b4..5b22eeb 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,7 +1,5 @@ parameters: level: 9 - excludePaths: - - src/Generated/* paths: - src - tests