Skip to content

Commit

Permalink
add gitlab-ci support to individual plugin folder
Browse files Browse the repository at this point in the history
  • Loading branch information
weilai-irl committed Nov 8, 2024
1 parent 3938102 commit 27c44c4
Show file tree
Hide file tree
Showing 16 changed files with 773 additions and 289 deletions.
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_401_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
41 changes: 0 additions & 41 deletions auth/oidc/.travis.yml

This file was deleted.

87 changes: 87 additions & 0 deletions blocks/microsoft/.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
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_401_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 add-plugin --clone https://github.com/microsoft/moodle-auth_oidc.git --branch $MOODLE_BRANCH
- moodle-plugin-ci add-plugin --clone https://github.com/microsoft/moodle-local_o365.git --branch $MOODLE_BRANCH
- 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
41 changes: 0 additions & 41 deletions blocks/microsoft/.travis.yml

This file was deleted.

86 changes: 86 additions & 0 deletions local/o365/.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
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_401_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 add-plugin --clone https://github.com/microsoft/moodle-auth_oidc.git --branch $MOODLE_BRANCH
- 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
41 changes: 0 additions & 41 deletions local/o365/.travis.yml

This file was deleted.

Loading

0 comments on commit 27c44c4

Please sign in to comment.