diff --git a/.github/actions/ci-prepare/action.yml b/.github/actions/ci-prepare/action.yml deleted file mode 100644 index 43ff94a..0000000 --- a/.github/actions/ci-prepare/action.yml +++ /dev/null @@ -1,96 +0,0 @@ -name: Prepare for CI - -description: Preparation for Moodle Continuous Integration - -inputs: - db: - description: Database Engine - required: true - php: - description: PHP version - required: true - moodle: - description: Moodle version (branch name) - required: true - accessibility-branch: - description: Branch of accessibility plugin - required: true - default: ${{ github.ref }} - widget-backgroundcolour-branch: - description: Branch of background colour widget - required: true - default: '' - widget-fontface-branch: - description: Branch of font face widget - required: true - default: '' - widget-fontsize-branch: - description: Branch of font size widget - required: true - default: '' - widget-textcolour-branch: - description: Branch of text colour widget - required: true - default: '' - -runs: - using: composite - - steps: - - - name: Setup PHP ${{ inputs.php }} - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ inputs.php }} - extensions: - ini-values: max_input_vars=5000 - # If you are not using code coverage, keep "none". Otherwise, use "pcov" (Moodle 3.10 and up) or "xdebug". - # If you try to use code coverage with "none", it will fallback to phpdbg (which has known problems). - coverage: none - - - name: Checkout Accessibility Plugin - uses: actions/checkout@v4 - with: - path: plugin - ref: ${{ inputs.accessibility-branch }} - - - name: 'Checkout Widget: backgroundcolour' - uses: actions/checkout@v4 - with: - repository: ponlawat-w/moodle-accessibility_backgroundcolour - path: plugin/widgets/backgroundcolour - ref: ${{ inputs.widget-backgroundcolour-branch }} - - name: 'Checkout Widget: fontface' - uses: actions/checkout@v4 - with: - repository: ponlawat-w/moodle-accessibility_fontface - path: plugin/widgets/fontface - ref: ${{ inputs.widget-fontface-branch }} - - name: 'Checkout Widget: fontsize' - uses: actions/checkout@v4 - with: - repository: ponlawat-w/moodle-accessibility_fontsize - path: plugin/widgets/fontsize - ref: ${{ inputs.widget-fontsize-branch }} - - name: 'Checkout Widget: textcolour' - uses: actions/checkout@v4 - with: - repository: ponlawat-w/moodle-accessibility_textcolour - path: plugin/widgets/textcolour - ref: ${{ inputs.widget-textcolour-branch }} - - - 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 - sudo locale-gen en_AU.UTF-8 - echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV - - - name: Install moodle-plugin-ci - shell: bash - run: moodle-plugin-ci install --plugin ./plugin --db-host 127.0.0.1 - env: - DB: ${{ inputs.db }} - MOODLE_BRANCH: ${{ inputs.moodle }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6cb42d..f552f4a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -106,17 +106,62 @@ jobs: ref: ${{ github.ref }} sparse-checkout: .github - - name: Preparation - uses: ./.github/actions/ci-prepare + - name: Setup PHP ${{ matrix.php }} + uses: shivammathur/setup-php@v2 with: - moodle: ${{ matrix.moodle }} - php: ${{ matrix.php }} - db: ${{ matrix.db }} - accessibility-branch: ${{ inputs.accessibility-branch }} - widget-backgroundcolour-branch: ${{ needs.set-widget-versions.outputs.widget-backgroundcolour-branch }} - widget-fontface-branch: ${{ needs.set-widget-versions.outputs.widget-fontface-branch }} - widget-fontsize-branch: ${{ needs.set-widget-versions.outputs.widget-fontsize-branch }} - widget-textcolour-branch: ${{ needs.set-widget-versions.outputs.widget-textcolour-branch }} + php-version: ${{ matrix.php }} + extensions: + ini-values: max_input_vars=5000 + # If you are not using code coverage, keep "none". Otherwise, use "pcov" (Moodle 3.10 and up) or "xdebug". + # If you try to use code coverage with "none", it will fallback to phpdbg (which has known problems). + coverage: none + + - name: Checkout Accessibility Plugin + uses: actions/checkout@v4 + with: + path: plugin + ref: ${{ inputs.accessibility-branch }} + + - name: 'Checkout Widget: backgroundcolour' + uses: actions/checkout@v4 + with: + repository: ponlawat-w/moodle-accessibility_backgroundcolour + path: plugin/widgets/backgroundcolour + ref: ${{ inputs.widget-backgroundcolour-branch }} + - name: 'Checkout Widget: fontface' + uses: actions/checkout@v4 + with: + repository: ponlawat-w/moodle-accessibility_fontface + path: plugin/widgets/fontface + ref: ${{ inputs.widget-fontface-branch }} + - name: 'Checkout Widget: fontsize' + uses: actions/checkout@v4 + with: + repository: ponlawat-w/moodle-accessibility_fontsize + path: plugin/widgets/fontsize + ref: ${{ inputs.widget-fontsize-branch }} + - name: 'Checkout Widget: textcolour' + uses: actions/checkout@v4 + with: + repository: ponlawat-w/moodle-accessibility_textcolour + path: plugin/widgets/textcolour + ref: ${{ inputs.widget-textcolour-branch }} + + - 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 + sudo locale-gen en_AU.UTF-8 + echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV + + - name: Install moodle-plugin-ci + shell: bash + run: moodle-plugin-ci install --plugin ./plugin --db-host 127.0.0.1 + env: + DB: ${{ matrix.db }} + MOODLE_BRANCH: ${{ matrix.moodle }} - name: PHP Lint if: ${{ !cancelled() }}