name: Tests on: push: branches: - main pull_request: workflow_dispatch: permissions: contents: read jobs: metadata: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: '8.4' coverage: none - name: Validate Composer metadata run: composer validate --strict --no-check-publish - name: Check JavaScript syntax run: node --check dist/js/form-dock.js nova-credentials: runs-on: ubuntu-latest outputs: available: ${{ steps.credentials.outputs.available }} steps: - name: Check Nova credentials id: credentials env: NOVA_USERNAME: ${{ secrets.NOVA_USERNAME }} NOVA_LICENSE_KEY: ${{ secrets.NOVA_LICENSE_KEY }} run: | if [[ -n "$NOVA_USERNAME" && -n "$NOVA_LICENSE_KEY" ]]; then echo "available=true" >> "$GITHUB_OUTPUT" else echo "available=false" >> "$GITHUB_OUTPUT" echo "Nova credentials are unavailable; the licensed test matrix will be skipped." fi tests: needs: nova-credentials if: needs.nova-credentials.outputs.available == 'true' runs-on: ubuntu-latest strategy: fail-fast: false matrix: php: ['8.2', '8.3', '8.4', '8.5'] name: PHP ${{ matrix.php }} steps: - name: Checkout uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} coverage: none - name: Configure Nova authentication run: composer config http-basic.nova.laravel.com "${{ secrets.NOVA_USERNAME }}" "${{ secrets.NOVA_LICENSE_KEY }}" - name: Install dependencies run: composer install --no-interaction --prefer-dist - name: Check formatting run: vendor/bin/pint --test - name: Run tests run: composer test