Skip to content

Commit 7949fe3

Browse files
author
Laur0r
authored
Merge pull request #38 from justusdieckmann/update/m40
Update for Moodle 4.0
2 parents befff0c + 537e3b9 commit 7949fe3

File tree

5 files changed

+81
-10
lines changed

5 files changed

+81
-10
lines changed

.github/workflows/moodle-ci.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,29 @@ jobs:
66
static:
77
runs-on: ubuntu-latest
88

9+
outputs:
10+
has_tests: ${{ steps.check_tests.outputs.has_tests }}
11+
912
strategy:
1013
matrix:
1114
php: ['7.4']
12-
moodle-branch: ['MOODLE_311_STABLE']
15+
moodle-branch: ['MOODLE_400_STABLE']
1316
database: ['pgsql']
1417

1518
steps:
1619
- name: Start PostgreSQL
17-
run: docker run -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_HOST_AUTH_METHOD=trust -d postgres:9.6
20+
run: docker run -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_HOST_AUTH_METHOD=trust -d postgres:10
1821

1922
- name: Check out repository code
2023
uses: actions/checkout@v2
2124
with:
2225
path: plugin
2326

27+
- name: Check for test folder
28+
id: check_tests
29+
run: |
30+
echo "::set-output name=has_tests::${{ hashFiles('plugin/tests') != '' }}"
31+
2432
- name: Setup PHP ${{ matrix.php }}
2533
uses: shivammathur/setup-php@v2
2634
with:
@@ -102,12 +110,13 @@ jobs:
102110
test:
103111
runs-on: ubuntu-latest
104112
needs: static
113+
if: ${{ needs.static.outputs.has_tests == 'true' }}
105114

106115
strategy:
107116
fail-fast: false
108117
matrix:
109-
php: ['7.3', '7.4']
110-
moodle-branch: ['MOODLE_39_STABLE', 'MOODLE_310_STABLE', 'MOODLE_311_STABLE']
118+
php: ['7.4']
119+
moodle-branch: ['MOODLE_39_STABLE', 'MOODLE_310_STABLE', 'MOODLE_311_STABLE', 'MOODLE_400_STABLE']
111120
database: ['mariadb', 'pgsql']
112121

113122
steps:
@@ -117,7 +126,7 @@ jobs:
117126

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

122131
- name: Check out repository code
123132
uses: actions/checkout@v2
@@ -169,4 +178,4 @@ jobs:
169178

170179
- name: Behat features
171180
if: ${{ always() }}
172-
run: moodle-plugin-ci behat --profile chrome
181+
run: moodle-plugin-ci behat
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#
2+
# Whenever a new tag starting with "v" is pushed, add the tagged version
3+
# to the Moodle Plugins directory at https://moodle.org/plugins
4+
#
5+
# revision: 2021070201
6+
# Changed to be released on Github release with the release notes.
7+
#
8+
name: Releasing in the Plugins directory
9+
10+
on:
11+
release:
12+
types: [published]
13+
14+
defaults:
15+
run:
16+
shell: bash
17+
18+
jobs:
19+
release-at-moodle-org:
20+
runs-on: ubuntu-latest
21+
env:
22+
PLUGIN: block_groups
23+
CURL: curl -s
24+
ENDPOINT: https://moodle.org/webservice/rest/server.php
25+
TOKEN: ${{ secrets.MOODLE_ORG_TOKEN }}
26+
FUNCTION: local_plugins_add_version
27+
28+
steps:
29+
- name: Call the service function
30+
id: add-version
31+
run: |
32+
TAGNAME="${{ github.event.release.tag_name }}"
33+
BODY="${{ github.event.release.body }}"
34+
ZIPURL="${{ github.event.release.zipball_url }}"
35+
RESPONSE=$(${CURL} ${ENDPOINT} --data-urlencode "wstoken=${TOKEN}" \
36+
--data-urlencode "wsfunction=${FUNCTION}" \
37+
--data-urlencode "moodlewsrestformat=json" \
38+
--data-urlencode "frankenstyle=${PLUGIN}" \
39+
--data-urlencode "zipurl=${ZIPURL}" \
40+
--data-urlencode "vcssystem=git" \
41+
--data-urlencode "vcsrepositoryurl=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" \
42+
--data-urlencode "vcstag=${TAGNAME}" \
43+
--data-urlencode "changelogurl=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/commits/${TAGNAME}" \
44+
--data-urlencode "altdownloadurl=${ZIPURL}" \
45+
--data-urlencode "releasenotes=${BODY}" \
46+
--data-urlencode "releasenotesformat=4")
47+
echo "::set-output name=response::${RESPONSE}"
48+
- name: Evaluate the response
49+
id: evaluate-response
50+
env:
51+
RESPONSE: ${{ steps.add-version.outputs.response }}
52+
run: |
53+
jq <<< ${RESPONSE}
54+
jq --exit-status ".id" <<< ${RESPONSE} > /dev/null

amd/build/blocks_groups_visibility.min.js

Lines changed: 10 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)