-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
1,696 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ master, develop ] | ||
pull_request: | ||
branches: [ "*" ] | ||
|
||
jobs: | ||
test: | ||
name: "PHPUnit: MW ${{ matrix.mw }}, PHP ${{ matrix.php }}" | ||
continue-on-error: ${{ matrix.experimental }} | ||
|
||
strategy: | ||
matrix: | ||
include: | ||
- mw: 'REL1_39' | ||
php: 8.1 | ||
experimental: false | ||
- mw: 'REL1_40' | ||
php: 8.1 | ||
experimental: true | ||
- mw: 'master' | ||
php: 8.1 | ||
experimental: true | ||
|
||
runs-on: ubuntu-latest | ||
|
||
defaults: | ||
run: | ||
working-directory: mediawiki | ||
|
||
steps: | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: mbstring, intl | ||
tools: composer | ||
|
||
- name: Cache MediaWiki | ||
id: cache-mediawiki | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
mediawiki | ||
!mediawiki/extensions/ | ||
!mediawiki/vendor/ | ||
key: mw_${{ matrix.mw }}-php${{ matrix.php }}-v20 | ||
|
||
- name: Cache Composer cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.composer/cache | ||
key: composer-php${{ matrix.php }} | ||
|
||
- uses: actions/checkout@v3 | ||
with: | ||
path: EarlyCopy | ||
|
||
- name: Install MediaWiki | ||
if: steps.cache-mediawiki.outputs.cache-hit != 'true' | ||
working-directory: ~ | ||
run: bash EarlyCopy/.github/workflows/installWiki.sh ${{ matrix.mw }} | ||
|
||
- uses: actions/checkout@v3 | ||
with: | ||
path: mediawiki/extensions/Plausible | ||
|
||
- name: Composer update | ||
run: composer update | ||
|
||
- name: Run PHPUnit | ||
run: composer phpunit:entrypoint -- --group Plausible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#! /bin/bash | ||
|
||
MW_BRANCH=$1 | ||
EXTENSION_NAME=$2 | ||
|
||
wget https://github.com/wikimedia/mediawiki/archive/$MW_BRANCH.tar.gz -nv | ||
|
||
tar -zxf $MW_BRANCH.tar.gz | ||
mv mediawiki-$MW_BRANCH mediawiki | ||
|
||
cd mediawiki | ||
|
||
composer install | ||
php maintenance/install.php --dbtype sqlite --dbuser root --dbname mw --dbpath $(pwd) --pass AdminPassword WikiName AdminUser | ||
|
||
# echo 'error_reporting(E_ALL| E_STRICT);' >> LocalSettings.php | ||
# echo 'ini_set("display_errors", 1);' >> LocalSettings.php | ||
echo '$wgShowExceptionDetails = true;' >> LocalSettings.php | ||
echo '$wgShowDBErrorBacktrace = true;' >> LocalSettings.php | ||
echo '$wgDevelopmentWarnings = true;' >> LocalSettings.php | ||
|
||
echo 'wfLoadExtension( "Plausible" );' >> LocalSettings.php | ||
|
||
cat <<EOT >> composer.local.json | ||
{ | ||
"require": { | ||
}, | ||
"extra": { | ||
"merge-plugin": { | ||
"merge-dev": true, | ||
"include": [] | ||
} | ||
} | ||
} | ||
EOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Lint Tests | ||
on: | ||
push: | ||
branches: [ master, develop, feature/** ] | ||
pull_request: | ||
branches: [ master ] | ||
jobs: | ||
lint-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Installing PHP | ||
uses: shivammathur/setup-php@master | ||
with: | ||
php-version: '8.0' | ||
- name: Get Composer Cache Directory 2 | ||
id: composer-cache | ||
run: | | ||
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | ||
- uses: actions/cache@v3 | ||
id: actions-cache | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-composer- | ||
- name: Cache PHP dependencies | ||
uses: actions/cache@v3 | ||
id: vendor-cache | ||
with: | ||
path: vendor | ||
key: ${{ runner.OS }}-build-${{ hashFiles('**/composer.lock') }} | ||
- name: Composer install | ||
if: steps.vendor-cache.outputs.cache-hit != 'true' | ||
run: composer install --no-ansi --no-interaction --no-scripts --no-suggest --prefer-dist | ||
- name: Run Test | ||
run: composer run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.