Skip to content

Commit

Permalink
Add a unique workspace for each matrix job
Browse files Browse the repository at this point in the history
  • Loading branch information
mona-shakiba committed Feb 11, 2025
1 parent b7c7185 commit a87c206
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion .github/workflows/moodle-plugin-ci-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,23 @@ jobs:
database: mariadb

steps:
- name: Setup unique workspace
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
- name: Check out repository code
uses: actions/checkout@v3
with:
path: plugin
path: ${{ env.MATRIX_WORKSPACE }}/plugin

# - name: Check out repository code
# uses: actions/checkout@v3
# with:
# path: plugin

- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
Expand All @@ -73,6 +86,7 @@ jobs:

- name: Initialise moodle-plugin-ci
run: |
cd ${{ env.MATRIX_WORKSPACE }}
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 @@ -81,6 +95,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 }}
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 @@ -94,47 +109,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() }}
run: moodle-plugin-ci phplint

- name: PHP Copy/Paste Detector
working-directory: ${{ env.MATRIX_WORKSPACE }}
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 }}
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 }}
if: ${{ always() }}
run: moodle-plugin-ci codechecker --max-warnings 0

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

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

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

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

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

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

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

0 comments on commit a87c206

Please sign in to comment.