Repository navigation
feat: Add ClamAV container with automatic config wiring for PHP 8.4 and 8.5 #74
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Check config.php is valid | |
| on: | |
| pull_request: | |
| paths: | |
| - 'config.php' | |
| - 'php/includes/**' | |
| - '.github/workflows/validate-config.yml' | |
| jobs: | |
| validate-config: | |
| name: Validate for PHP ${{ matrix.php-version }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| php-version: ['8.5', '5.5'] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Create symlinks for config.php includes | |
| run: | | |
| sudo mkdir -p /var/www/totara | |
| sudo ln -sf "$GITHUB_WORKSPACE/php/includes" /var/www/totara/includes | |
| - name: Set up PHP ${{ matrix.php-version }} | |
| uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1 | |
| with: | |
| php-version: ${{ matrix.php-version }} | |
| - name: Validate config.php syntax (PHP ${{ matrix.php-version }}) | |
| run: php -l ./config.php && find ./php/includes -name '*.php' -exec php -l {} + | |
| - name: Check that required $CFG variables are defined (PHP ${{ matrix.php-version }}) | |
| run: | | |
| php -r ' | |
| define("CLI_SCRIPT", true); | |
| define("ABORT_AFTER_CONFIG", true); | |
| include "config.php"; | |
| foreach (["dbhost", "dbtype", "dbuser", "dbpass", "dbname", "prefix", "wwwroot", "dataroot"] as $var) { | |
| if (!isset($CFG->{$var})) { | |
| fwrite(STDERR, "Missing \$CFG->{$var} from config.php (or from php/includes/) - is it commented out?\n"); | |
| exit(1); | |
| } | |
| } | |
| ' |