Skip to content

Commit

Permalink
Structure
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyserver committed Oct 23, 2023
1 parent 98ef26b commit a85b635
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 62 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/structure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Update Moodle WS Structure

on:
workflow_dispatch:
inputs:
moodle_branch:
description: 'Moodle branch'
required: true
default: 'master'
schedule:
- cron: '0 4 * * *'
push:

jobs:
structure:
runs-on: ubuntu-latest
services:
exttests:
image: moodlehq/moodle-exttests
ports:
- 8080:80
redis:
image: redis
ports:
- 6379:6379

strategy:
matrix:
moodle_branch: ['master'] # , 'MOODLE_401_STABLE', 'MOODLE_402_STABLE', 'MOODLE_403_STABLE'
env:
dbtype: pgsql
php: 8.2
MOODLE_BRANCH: ${{ github.event.inputs.moodle_branch || 'master' }}
MOODLE_REPOSITORY: 'https://github.com/moodle/moodle'
steps:
- name: Checking out code from ${{ env.GITHUB_REF_SLUG }}
uses: actions/checkout@v3

- name: Checking out Moodle ${{ env.MOODLE_BRANCH }}
run: |
git clone --branch $MOODLE_BRANCH --depth 1 $MOODLE_REPOSITORY $GITHUB_WORKSPACE/moodle
- name: Setting up DB ${{ env.dbtype }}
uses: m4nu56/postgresql-action@v1
with:
postgresql version: 13
postgresql db: test
postgresql user: test
postgresql password: test
- name: Setting up PHP ${{ env.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.php }}
ini-values: max_input_vars=5000
coverage: none

- name: Setting up Moodle
env:
dbtype: ${{ env.dbtype }}
run: |
pushd $GITHUB_WORKSPACE/moodle
echo "pathtophp=$(which php)" >> $GITHUB_ENV # Inject installed pathtophp to env. The template config needs it.
cp .github/workflows/config-template.php config.php
mkdir ../moodledata
php admin/cli/install_database.php --agree-license --adminpass=1234 [email protected] --fullname=Structure --shortname=structure --summary=Structure [email protected]
popd
- name: Run structure script
run: |
php scripts/get_all_ws_structures.php $GITHUB_WORKSPACE/moodle > /tmp/${{ env.MOODLE_BRANCH }}.ts
- name: Upload Behat failures
uses: actions/upload-artifact@v3
with:
name: structure
path: /tmp/${{ env.MOODLE_BRANCH }}.ts
62 changes: 0 additions & 62 deletions .github/workflows/testing.yml

This file was deleted.

0 comments on commit a85b635

Please sign in to comment.