|
| 1 | +name: Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + tags-ignore: |
| 8 | + - '**' |
| 9 | + pull_request: |
| 10 | + branches: |
| 11 | + - main |
| 12 | + |
| 13 | +jobs: |
| 14 | + |
| 15 | + check-php-syntax: |
| 16 | + name: PHP ${{ matrix.php-version }} Syntax |
| 17 | + runs-on: ubuntu-latest |
| 18 | + strategy: |
| 19 | + matrix: |
| 20 | + php-version: |
| 21 | + - "5.5" |
| 22 | + - "8.4" |
| 23 | + steps: |
| 24 | + - |
| 25 | + name: Checkout |
| 26 | + uses: actions/checkout@v4 |
| 27 | + - |
| 28 | + name: Install PHP |
| 29 | + uses: shivammathur/setup-php@v2 |
| 30 | + with: |
| 31 | + php-version: ${{ matrix.php-version }} |
| 32 | + extensions: opcache |
| 33 | + coverage: none |
| 34 | + tools: none |
| 35 | + - |
| 36 | + name: Check syntax |
| 37 | + uses: mlocati/check-php-syntax@v1 |
| 38 | + with: |
| 39 | + fail-on-warnings: true |
| 40 | + |
| 41 | + check-development-leftovers: |
| 42 | + name: Check Development Leftovers |
| 43 | + runs-on: ubuntu-latest |
| 44 | + steps: |
| 45 | + - |
| 46 | + name: Checkout |
| 47 | + uses: actions/checkout@v4 |
| 48 | + - |
| 49 | + name: Search for debugger or xdebug_break |
| 50 | + run: | |
| 51 | + echo "Scanning for 'debugger' or 'xdebug_break'..." |
| 52 | + matches=$(grep -Enr --include=\*.{js,php} '(^|[^a-zA-Z0-9_])(debugger|xdebug_break)\b' . || true) |
| 53 | + if [[ -n "$matches" ]]; then |
| 54 | + echo "Found the following matches:" |
| 55 | + echo "$matches" |
| 56 | + echo "::error::Development leftovers found in the codebase." |
| 57 | + exit 1 |
| 58 | + else |
| 59 | + echo "No development leftovers found." |
| 60 | + fi |
| 61 | +
|
| 62 | + check-install: |
| 63 | + name: Install on Concrete ${{ matrix.ccm-version }} |
| 64 | + runs-on: ubuntu-latest |
| 65 | + container: ghcr.io/concrete5-community/docker5:${{ matrix.ccm-version }} |
| 66 | + needs: |
| 67 | + - check-php-syntax |
| 68 | + - check-development-leftovers |
| 69 | + strategy: |
| 70 | + matrix: |
| 71 | + ccm-version: |
| 72 | + - 8.5.12 |
| 73 | + - "8.5" |
| 74 | + - "9.0" |
| 75 | + - "9.1" |
| 76 | + - "9.2" |
| 77 | + - "9.3" |
| 78 | + - "9.4" |
| 79 | + - latest |
| 80 | + steps: |
| 81 | + - |
| 82 | + name: Checkout |
| 83 | + uses: actions/checkout@v4 |
| 84 | + - |
| 85 | + name: Check composer.json |
| 86 | + run: sudo -u www-data composer --ansi --no-interaction validate --strict -- "$GITHUB_WORKSPACE/composer.json" |
| 87 | + - |
| 88 | + name: Prepare package |
| 89 | + run: ln -s "$GITHUB_WORKSPACE" /app/packages/maxmind_geolocator |
| 90 | + - |
| 91 | + name: Start services |
| 92 | + run: ccm-service start db |
| 93 | + - |
| 94 | + name: Core info |
| 95 | + run: sudo -u www-data /app/concrete/bin/concrete5 --ansi --no-interaction c5:info |
| 96 | + - |
| 97 | + name: Install package |
| 98 | + run: sudo -u www-data /app/concrete/bin/concrete5 --ansi --no-interaction c5:package:install maxmind_geolocator |
0 commit comments