Skip to content

Commit

Permalink
create a matrix-specific subdirectory within the default workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
mona-shakiba committed Feb 11, 2025
1 parent 4970dee commit 4913a8d
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions .github/workflows/moodle-plugin-ci-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,17 @@ jobs:
database: mariadb

steps:
- name: Setup unique workspace
- name: Clean workspace for matrix job
run: |
MATRIX_ID="${{ matrix.php }}-${{ matrix.database }}-${{ matrix.moodle-branch }}"
WORKSPACE="/home/action/actions-runner/_work/moodle-local_catquiz/moodle-local_catquiz-${MATRIX_ID}"
rm -rf "$WORKSPACE"
mkdir -p "$WORKSPACE"
echo "MATRIX_WORKSPACE=$WORKSPACE" >> $GITHUB_ENV
MATRIX_ID="${{ matrix.php }}-${{ matrix.database }}-${{ matrix.moodle-branch }}"
rm -rf "$GITHUB_WORKSPACE"
mkdir -p "$GITHUB_WORKSPACE/matrix-$MATRIX_ID"
echo "MATRIX_DIR=matrix-$MATRIX_ID" >> $GITHUB_ENV
- name: Check out repository code
uses: actions/checkout@v3
with:
path: ${{ env.MATRIX_WORKSPACE }}/plugin
path: ${{ env.MATRIX_DIR }}/plugin

# - name: Check out repository code
# uses: actions/checkout@v3
Expand Down Expand Up @@ -86,7 +85,7 @@ jobs:

- name: Initialise moodle-plugin-ci
run: |
cd ${{ env.MATRIX_WORKSPACE }}
cd ${{ github.workspace }}/${{ env.MATRIX_DIR }}
export NVM_DIR="$HOME/.nvm"
[ -s $NVM_DIR/nvm.sh ] && source $NVM_DIR/nvm.sh
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^4
Expand All @@ -95,7 +94,7 @@ jobs:
sudo locale-gen en_AU.UTF-8
echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV
- name: Install moodle-plugin-ci
working-directory: ${{ env.MATRIX_WORKSPACE }}
working-directory: ${{ github.workspace }}/${{ env.MATRIX_DIR }}
run: |
moodle-plugin-ci add-plugin --branch main Wunderbyte-GmbH/moodle-local_wunderbyte_table
moodle-plugin-ci add-plugin --branch catmodel_main Wunderbyte-GmbH/moodle-mod_adaptivequiz
Expand All @@ -109,58 +108,58 @@ jobs:
MUSTACHE_IGNORE_NAMES: 'feedbackform_collapsible_close.mustache,feedbackform_collapsible_open.mustache,catscaleshortcodetablechildren.mustache'

- name: PHP Lint
working-directory: ${{ env.MATRIX_WORKSPACE }}
if: ${{ always() }}
working-directory: ${{ github.workspace }}/${{ env.MATRIX_DIR }}
run: moodle-plugin-ci phplint

- name: PHP Copy/Paste Detector
working-directory: ${{ env.MATRIX_WORKSPACE }}
working-directory: ${{ github.workspace }}/${{ env.MATRIX_DIR }}
continue-on-error: true # This step will show errors but will not fail
if: ${{ always() }}
run: moodle-plugin-ci phpcpd

- name: PHP Mess Detector
working-directory: ${{ env.MATRIX_WORKSPACE }}
working-directory: ${{ github.workspace }}/${{ env.MATRIX_DIR }}
continue-on-error: true # This step will show errors but will not fail
if: ${{ always() }}
run: moodle-plugin-ci phpmd

- name: Moodle Code Checker
working-directory: ${{ env.MATRIX_WORKSPACE }}
working-directory: ${{ github.workspace }}/${{ env.MATRIX_DIR }}
if: ${{ always() }}
run: moodle-plugin-ci codechecker --max-warnings 0

- name: Moodle PHPDoc Checker
working-directory: ${{ env.MATRIX_WORKSPACE }}
working-directory: ${{ github.workspace }}/${{ env.MATRIX_DIR }}
if: ${{ always() }}
run: moodle-plugin-ci phpdoc

- name: Validating
working-directory: ${{ env.MATRIX_WORKSPACE }}
working-directory: ${{ github.workspace }}/${{ env.MATRIX_DIR }}
if: ${{ always() }}
run: moodle-plugin-ci validate

- name: Check upgrade savepoints
working-directory: ${{ env.MATRIX_WORKSPACE }}
working-directory: ${{ github.workspace }}/${{ env.MATRIX_DIR }}
if: ${{ always() }}
run: moodle-plugin-ci savepoints

- name: Mustache Lint
working-directory: ${{ env.MATRIX_WORKSPACE }}
working-directory: ${{ github.workspace }}/${{ env.MATRIX_DIR }}
if: ${{ always() }}
run: moodle-plugin-ci mustache

- name: Grunt
working-directory: ${{ env.MATRIX_WORKSPACE }}
working-directory: ${{ github.workspace }}/${{ env.MATRIX_DIR }}
if: ${{ always() }}
run: moodle-plugin-ci grunt --max-lint-warnings 0

- name: PHPUnit tests
working-directory: ${{ env.MATRIX_WORKSPACE }}
working-directory: ${{ github.workspace }}/${{ env.MATRIX_DIR }}
if: ${{ always() }}
run: moodle-plugin-ci phpunit --testdox

- name: Behat features
working-directory: ${{ env.MATRIX_WORKSPACE }}
working-directory: ${{ github.workspace }}/${{ env.MATRIX_DIR }}
if: ${{ always() }}
run: moodle-plugin-ci behat --profile chrome

0 comments on commit 4913a8d

Please sign in to comment.