Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/learninghub-moodle_Deploy_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ jobs:

- name: Disable automounting API credentials
run: |
kubectl patch deployment learninghubmoodledev -p "{\"spec\": {\"template\": {\"spec\": {\"automountServiceAccountToken\": false}}}}" -n learninghubmoodle
kubectl patch deployment learninghubmoodletest -p "{\"spec\": {\"template\": {\"spec\": {\"automountServiceAccountToken\": false}}}}" -n learninghubmoodle
kubectl patch serviceaccount default -p "{\"automountServiceAccountToken\": false}" -n learninghubmoodle

- name: Get node resource group
Expand Down Expand Up @@ -313,4 +313,4 @@ jobs:

- name: Define trusted container registries
run: |
az policy assignment create --resource-group ${{ vars.AZURE_RESOURCE_GROUP_NAME }} --name "EnforceTrustedRegistries" --policy "febd0533-8e55-448f-b837-bd0e06f16469" --params "{\"allowedContainerImagesRegex\":{\"value\":\"learninghubmoodlecrdev.azurecr.io\"}}" --location uksouth
az policy assignment create --resource-group ${{ vars.AZURE_RESOURCE_GROUP_NAME }} --name "EnforceTrustedRegistries" --policy "febd0533-8e55-448f-b837-bd0e06f16469" --params "{\"allowedContainerImagesRegex\":{\"value\":\"learninghubmoodlecrtest.azurecr.io\"}}" --location uksouth
2 changes: 1 addition & 1 deletion Terraform/test/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ resource "azurerm_kubernetes_cluster" "aks" {
dns_prefix = var.ClusterName
default_node_pool {
name = "default"
vm_size = "Standard_B4ms"
vm_size = "Standard_D4s_v3"
temporary_name_for_rotation = "tmpnodepool1"
auto_scaling_enabled = true
min_count = 2
Expand Down
7 changes: 7 additions & 0 deletions auth/oidc/.github/PULL_REQUEST_TEMPLATE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
*** PLEASE DO NOT OPEN PULL REQUESTS IN THIS REPO ***

This is a read-only repository for Moodle plugins directory release process. All developments are carried out in the main project repository at https://github.com/microsoft/o365-moodle. Please create your pull requests there.

Thank you.

--
126 changes: 126 additions & 0 deletions auth/oidc/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: Moodle Plugin CI for auth_oidc

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
push:
branches:
- 'MOODLE_*_STABLE'
pull_request:

jobs:
check:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:13
env:
POSTGRES_USER: 'postgres'
POSTGRES_HOST_AUTH_METHOD: 'trust'
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3

mariadb:
image: mariadb:10
env:
MYSQL_USER: 'root'
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
MYSQL_CHARACTER_SET_SERVER: "utf8mb4"
MYSQL_COLLATION_SERVER: "utf8mb4_unicode_ci"
MYSQL_INNODB_FILE_PER_TABLE: "1"
MYSQL_INNODB_FILE_FORMAT: "Barracuda"
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 3

strategy:
fail-fast: false
matrix:
moodle-branch: ['MOODLE_405_STABLE']
php: [8.1, 8.2, 8.3]
database: [pgsql, mariadb]

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

- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: max_input_vars=5000
coverage: none

- name: Initialise moodle-plugin-ci
run: |
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^4
echo $(cd ci/bin; pwd) >> $GITHUB_PATH
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
sudo locale-gen en_AU.UTF-8
echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV

- name: Install moodle-plugin-ci
run: |
moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
env:
DB: ${{ matrix.database }}
MOODLE_BRANCH: ${{ matrix.moodle-branch }}
SHELLOPTS: errexit:nounset:xtrace

- name: PHP Lint
if: ${{ !cancelled() }}
run: moodle-plugin-ci phplint

- name: PHP Mess Detector
continue-on-error: true
if: ${{ !cancelled() }}
run: moodle-plugin-ci phpmd

- name: Moodle Code Checker
if: ${{ !cancelled() }}
run: moodle-plugin-ci phpcs --max-warnings 0

- name: Moodle PHPDoc Checker
if: ${{ !cancelled() }}
run: moodle-plugin-ci phpdoc --max-warnings 0

- name: Validating
if: ${{ !cancelled() }}
run: moodle-plugin-ci validate

- name: Check upgrade savepoints
if: ${{ !cancelled() }}
run: moodle-plugin-ci savepoints

- name: Mustache Lint
if: ${{ !cancelled() }}
run: moodle-plugin-ci mustache

- name: Grunt
if: ${{ !cancelled() }}
run: moodle-plugin-ci grunt --max-lint-warnings 0

- name: PHPUnit tests
if: ${{ !cancelled() }}
run: moodle-plugin-ci phpunit

- name: Behat features
id: behat
if: ${{ !cancelled() }}
run: moodle-plugin-ci behat --profile chrome

- name: Cleanup after behat
if: ${{ always() }}
run: |
sudo pkill -f chrome
sudo pkill -f chromedriver

- name: Mark cancelled jobs as failed.
if: ${{ cancelled() }}
run: exit 1
85 changes: 85 additions & 0 deletions auth/oidc/.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
services:
- name: selenium/standalone-chrome:3
alias: behat
- name: mysql:8.0
alias: db
command:
- '--character-set-server=utf8mb4'
- '--collation-server=utf8mb4_unicode_ci'
- '--innodb_file_per_table=On'
- '--wait-timeout=28800'
- '--skip-log-bin'

cache:
paths:
- .cache

variables:
DEBIAN_FRONTEND: 'noninteractive'
COMPOSER_ALLOW_SUPERUSER: 1
COMPOSER_CACHE_DIR: "$CI_PROJECT_DIR/.cache/composer"
NPM_CONFIG_CACHE: "$CI_PROJECT_DIR/.cache/npm"
CI_BUILD_DIR: '/tmp/plugin'
MOODLE_BRANCH: 'MOODLE_405_STABLE'
MOODLE_BEHAT_WWWROOT: 'http://localhost:8000'
MOODLE_BEHAT_WDHOST: 'http://behat:4444/wd/hub'
MOODLE_START_BEHAT_SERVERS: 'no'
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
DB: 'mysqli'

stages:
- moodle-plugin-ci

.setupandruncheck: &setupandruncheck
stage: moodle-plugin-ci
before_script:
- mkdir -pv "$CI_BUILD_DIR"
- cp -ru "$CI_PROJECT_DIR/"* "$CI_BUILD_DIR"
- mkdir -p /usr/share/man/man1 /usr/share/man/man3 /usr/share/man/man7
- apt-get -qq update
- apt-get -yqq install --no-install-suggests default-jre-headless default-mysql-client
- 'curl -sS https://raw.githubusercontent.com/creationix/nvm/v0.39.3/install.sh | bash'
- . ~/.bashrc
- nvm install --default --latest-npm lts/gallium
- 'curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer'
- composer create-project -n --no-dev --no-progress --no-ansi moodlehq/moodle-plugin-ci /opt/mci ^4
- export PATH="/opt/mci/bin:/opt/mci/vendor/bin:$PATH"
- moodle-plugin-ci install --db-host db --db-name moodle
- '{ php -S 0.0.0.0:8000 -t "$CI_PROJECT_DIR/moodle" >/dev/null 2>&1 & }'
- TXT_RED="\e[31m"

script:
- errors=()
- moodle-plugin-ci phplint || errors+=("phplint")
- moodle-plugin-ci phpmd || errors+=("phpmd")
- moodle-plugin-ci codechecker --max-warnings 0 || errors+=("codechecker")
- moodle-plugin-ci phpdoc --max-warnings 0 || errors+=("phpdoc")
- moodle-plugin-ci validate || errors+=("validate")
- moodle-plugin-ci savepoints || errors+=("savepoints")
- moodle-plugin-ci mustache || errors+=("mustache")
- moodle-plugin-ci grunt --max-lint-warnings 0 || errors+=("grunt")
- moodle-plugin-ci phpunit || errors+=("phpunit")
- moodle-plugin-ci behat --auto-rerun 0 --profile chrome || errors+=("behat")
- |-
if [ ${#errors[@]} -ne 0 ]; then
echo -e "${TXT_RED}Check errors: ${errors[@]}";
exit 1;
fi

php81:
tags:
- docker
image: moodlehq/moodle-php-apache:8.1
<<: *setupandruncheck

php82:
tags:
- docker
image: moodlehq/moodle-php-apache:8.2
<<: *setupandruncheck

php83:
tags:
- docker
image: moodlehq/moodle-php-apache:8.3
<<: *setupandruncheck
Loading
Loading