Skip to content

Commit

Permalink
Merge branch 'main' into 31-homework-student-feature-pretify-the-prep…
Browse files Browse the repository at this point in the history
…aration-feed
  • Loading branch information
Not-Brundle committed Nov 27, 2024
2 parents 908b02c + 306ea75 commit c11770e
Show file tree
Hide file tree
Showing 115 changed files with 11,238 additions and 367 deletions.
84 changes: 84 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,87 @@ jobs:
run: |
cd ${{ github.workspace }}/server/moodle
vendor/bin/phpunit --testsuite block_homework_testsuite
homework-plugin-test-macos:
runs-on: macos-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup PHP
id: setup-php
uses: shivammathur/setup-php@v2
with:
extensions: mbstring, intl, iconv, gd, sodium, zip, fileinfo, phar, mysqli
tools: composer

- name: Set up php.ini
run: >
PHP_INI_PATH=$(php --ini | grep "Loaded Configuration File" | awk '{print $4}')
sudo sed -i \
-e '$a\
max_input_vars=5000' \
"$PHP_INI_PATH"
- name: Install/Update Composer
run: composer self-update --2

- name: Set up MariaDB
uses: ankane/setup-mariadb@v1
with:
database: moodle

- name: Configure MariaDB root user
run: |
sudo mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED BY '';"
- name: Install Moodle Composer dependencies
run: |
cd ${{ github.workspace }}/server/moodle
composer install
- name: Import MoodleSQL file
run: |
mysql moodle < ${{ github.workspace }}/MoodleSQL.sql
- name: Run Moodle installation CLI
run: |
php ${{ github.workspace }}/server/moodle/admin/cli/install.php \
--lang=en \
--wwwroot="http://localhost:8000/" \
--dbhost="127.0.0.1" \
--dbname="moodle" \
--dbuser="root" \
--dbpass="" \
--dataroot="${{ github.workspace }}/server/moodledata" \
--skip-database \
--non-interactive \
--agree-license \
--allow-unstable \
--fullname="Tests for Moodle Homework Plugin" \
--shortname="mhp" \
--adminpass="Admin.123"
- name: Configure PHPUnit
run: |
mkdir -p "${{ github.workspace }}/server/moodledata/phpunit"
echo "\$CFG->phpunit_prefix = 'phpu_';" >> "${{ github.workspace }}/server/moodle/config.php"
echo "\$CFG->phpunit_dataroot = '${{ github.workspace }}/server/moodledata/phpunit';" >> "${{ github.workspace }}/server/moodle/config.php"
- name: Initialize PHPUnit
run: php ${{ github.workspace }}/server/moodle/admin/tool/phpunit/cli/init.php

- name: Run tests on mod_homework
if: always()
run: |
cd ${{ github.workspace }}/server/moodle
vendor/bin/phpunit --testsuite mod_homework_testsuite
- name: Run tests on block_homework
if: always()
run: |
cd ${{ github.workspace }}/server/moodle
vendor/bin/phpunit --testsuite block_homework_testsuite
2 changes: 1 addition & 1 deletion server/moodle/blocks/homework/amd/build/clickInfo.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c11770e

Please sign in to comment.