Skip to content

Commit

Permalink
Merge pull request #38 from justusdieckmann/update/m40
Browse files Browse the repository at this point in the history
Update for Moodle 4.0
  • Loading branch information
Laur0r authored Apr 21, 2022
2 parents befff0c + 537e3b9 commit 7949fe3
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 10 deletions.
21 changes: 15 additions & 6 deletions .github/workflows/moodle-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,29 @@ jobs:
static:
runs-on: ubuntu-latest

outputs:
has_tests: ${{ steps.check_tests.outputs.has_tests }}

strategy:
matrix:
php: ['7.4']
moodle-branch: ['MOODLE_311_STABLE']
moodle-branch: ['MOODLE_400_STABLE']
database: ['pgsql']

steps:
- name: Start PostgreSQL
run: docker run -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_HOST_AUTH_METHOD=trust -d postgres:9.6
run: docker run -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_HOST_AUTH_METHOD=trust -d postgres:10

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

- name: Check for test folder
id: check_tests
run: |
echo "::set-output name=has_tests::${{ hashFiles('plugin/tests') != '' }}"
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
Expand Down Expand Up @@ -102,12 +110,13 @@ jobs:
test:
runs-on: ubuntu-latest
needs: static
if: ${{ needs.static.outputs.has_tests == 'true' }}

strategy:
fail-fast: false
matrix:
php: ['7.3', '7.4']
moodle-branch: ['MOODLE_39_STABLE', 'MOODLE_310_STABLE', 'MOODLE_311_STABLE']
php: ['7.4']
moodle-branch: ['MOODLE_39_STABLE', 'MOODLE_310_STABLE', 'MOODLE_311_STABLE', 'MOODLE_400_STABLE']
database: ['mariadb', 'pgsql']

steps:
Expand All @@ -117,7 +126,7 @@ jobs:

- name: Start PostgreSQL
if: matrix.database == 'pgsql'
run: docker run -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_HOST_AUTH_METHOD=trust -d postgres:9.6
run: docker run -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_HOST_AUTH_METHOD=trust -d postgres:10

- name: Check out repository code
uses: actions/checkout@v2
Expand Down Expand Up @@ -169,4 +178,4 @@ jobs:

- name: Behat features
if: ${{ always() }}
run: moodle-plugin-ci behat --profile chrome
run: moodle-plugin-ci behat
54 changes: 54 additions & 0 deletions .github/workflows/moodle-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#
# Whenever a new tag starting with "v" is pushed, add the tagged version
# to the Moodle Plugins directory at https://moodle.org/plugins
#
# revision: 2021070201
# Changed to be released on Github release with the release notes.
#
name: Releasing in the Plugins directory

on:
release:
types: [published]

defaults:
run:
shell: bash

jobs:
release-at-moodle-org:
runs-on: ubuntu-latest
env:
PLUGIN: block_groups
CURL: curl -s
ENDPOINT: https://moodle.org/webservice/rest/server.php
TOKEN: ${{ secrets.MOODLE_ORG_TOKEN }}
FUNCTION: local_plugins_add_version

steps:
- name: Call the service function
id: add-version
run: |
TAGNAME="${{ github.event.release.tag_name }}"
BODY="${{ github.event.release.body }}"
ZIPURL="${{ github.event.release.zipball_url }}"
RESPONSE=$(${CURL} ${ENDPOINT} --data-urlencode "wstoken=${TOKEN}" \
--data-urlencode "wsfunction=${FUNCTION}" \
--data-urlencode "moodlewsrestformat=json" \
--data-urlencode "frankenstyle=${PLUGIN}" \
--data-urlencode "zipurl=${ZIPURL}" \
--data-urlencode "vcssystem=git" \
--data-urlencode "vcsrepositoryurl=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" \
--data-urlencode "vcstag=${TAGNAME}" \
--data-urlencode "changelogurl=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/commits/${TAGNAME}" \
--data-urlencode "altdownloadurl=${ZIPURL}" \
--data-urlencode "releasenotes=${BODY}" \
--data-urlencode "releasenotesformat=4")
echo "::set-output name=response::${RESPONSE}"
- name: Evaluate the response
id: evaluate-response
env:
RESPONSE: ${{ steps.add-version.outputs.response }}
run: |
jq <<< ${RESPONSE}
jq --exit-status ".id" <<< ${RESPONSE} > /dev/null
12 changes: 10 additions & 2 deletions amd/build/blocks_groups_visibility.min.js

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

Loading

0 comments on commit 7949fe3

Please sign in to comment.