permissions httpd #90
This file contains 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: Automated testing for Windows | |
on: [push, pull_request] | |
env: | |
php: 8.1 | |
database: pgsql | |
jobs: | |
test: | |
name: Automated testing for Windows | |
runs-on: windows-2022 | |
strategy: | |
fail-fast: false | |
matrix: | |
moodle-branch: ['MOODLE_401_STABLE', 'MOODLE_405_STABLE'] | |
steps: | |
- name: Set git to use LF | |
run: | | |
git config --global core.autocrlf false | |
git config --global core.eol lf | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
with: | |
path: plugin | |
- name: Configure node & npm | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/iron | |
- name: Install node | |
run: | | |
curl -O -s https://raw.githubusercontent.com/moodle/moodle/refs/heads/${{ matrix.moodle-branch }}/npm-shrinkwrap.json | |
curl -O -s https://raw.githubusercontent.com/moodle/moodle/refs/heads/${{ matrix.moodle-branch }}/package.json | |
npm ci | |
- name: Setup PHP ${{ env.php }} | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ env.php }} | |
ini-values: max_input_vars=5000 | |
coverage: none | |
extensions: exif, fileinfo, gd, intl, pgsql, sodium, zip | |
env: | |
phpts: ts | |
- name: Setup PostgreSQL | |
run: | | |
$pgService = Get-Service -Name postgresql* | |
Set-Service -InputObject $pgService -Status running -StartupType automatic | |
Start-Process -FilePath "$env:PGBIN\pg_isready" -Wait -PassThru | |
- name: Initialise moodle-plugin-ci | |
shell: bash | |
run: | | |
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^4 | |
echo $(cd ci/bin; pwd) >> $GITHUB_PATH | |
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH | |
echo $(echo $PGBIN | sed s/C:/\\/c/ | tr \\\\ /) >> $GITHUB_PATH | |
- name: Install moodle-plugin-ci | |
shell: bash | |
run: | | |
moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1 --db-user=$PGUSER --db-pass=$PGPASSWORD | |
env: | |
DB: ${{ env.database }} | |
MOODLE_BRANCH: ${{ matrix.moodle-branch }} | |
- name: PHPUnit tests (disabled for speed) | |
if: false | |
shell: bash | |
run: moodle-plugin-ci phpunit --fail-on-warning | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '21' | |
- name: Setup Apache | |
run: | | |
$phpPath = "C:/tools/php" | |
$confFile = "C:/tools/Apache24/conf/httpd.conf" | |
# Add PHP module | |
Add-Content $confFile @" | |
LoadModule php_module $phpPath/php8apache2_4.dll | |
AddType application/x-httpd-php .php | |
PHPIniDir $phpPath | |
# Overwrite DocumentRoot | |
DocumentRoot D:/a/moodle-quiz_essaydownload/moodle-quiz_essaydownload | |
"@ | |
# Change Server Config | |
$config = Get-Content $confFile -Raw | |
$config = $config -replace 'Listen 80', 'Listen 8080' | |
$config = $config -replace 'ServerName localhost:80', 'ServerName localhost:8080' | |
$config = $config -replace 'Require all denied', 'Require all granted' | |
Set-Content $confFile $config | |
- name: Start Apache Server | |
run: | | |
Start-Service Apache24 | |
Get-Service Apache24 | |
- name: Init behat | |
shell: bash | |
run: | | |
php moodle/admin/tool/behat/cli/init.php | |
- name: Setup tmate session (disabled) | |
if: always() | |
uses: mxschmitt/action-tmate@v3 | |
timeout-minutes: 30 | |
- name: Behat features (disabled) | |
if: false | |
run: moodle-plugin-ci behat --auto-rerun 1 --profile chrome |