Skip to content

Commit

Permalink
Merge pull request #18 from Opencast-Moodle/update/m40
Browse files Browse the repository at this point in the history
Update for Moodle 4.0
  • Loading branch information
Laur0r authored May 25, 2022
2 parents 24134e0 + f79036d commit d6c8753
Show file tree
Hide file tree
Showing 13 changed files with 132 additions and 37 deletions.
25 changes: 15 additions & 10 deletions .github/workflows/moodle-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,30 @@ 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']
opencast: ['11.4']

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 @@ -99,12 +107,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', 'master']
php: ['7.4']
moodle-branch: ['MOODLE_39_STABLE', 'MOODLE_310_STABLE', 'MOODLE_311_STABLE', 'MOODLE_400_STABLE']
database: ['mariadb', 'pgsql']
opencast: ['11.4']

Expand All @@ -114,11 +123,7 @@ jobs:
run: docker run -p 3306:3306 -e MYSQL_USER=root -e MYSQL_ALLOW_EMPTY_PASSWORD=true -d mariadb:10

- name: Start PostgreSQL
if: matrix.database == 'pgsql' && matrix.moodle-branch != 'master'
run: docker run -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_HOST_AUTH_METHOD=trust -d postgres:9.6

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

- name: Check out opencast-docker
Expand Down Expand Up @@ -180,4 +185,4 @@ jobs:

- name: Behat features
if: ${{ always() }}
run: moodle-plugin-ci behat --profile chrome
run: moodle-plugin-ci behat --profile chrome --auto-rerun 0
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: mod_opencast
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
2 changes: 1 addition & 1 deletion amd/build/form_dependent_select.min.js

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

2 changes: 1 addition & 1 deletion amd/build/form_dependent_select.min.js.map

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

2 changes: 1 addition & 1 deletion amd/build/opencast_player.min.js

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

Loading

0 comments on commit d6c8753

Please sign in to comment.