-
-
Notifications
You must be signed in to change notification settings - Fork 23
94 lines (82 loc) · 3.51 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-20.04
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
include:
- mediawiki_version: '1.35'
database_type: sqlite
semantic_mediawiki_version: 4.1.0
coverage: true
experimental: false
- mediawiki_version: '1.36'
database_type: sqlite
semantic_mediawiki_version: dev-master
coverage: false
experimental: true
- mediawiki_version: '1.37'
database_type: sqlite
semantic_mediawiki_version: dev-master
coverage: false
experimental: true
container:
image: gesinn/docker-mediawiki-${{ matrix.database_type }}:${{ matrix.mediawiki_version }}
env:
EXT_NAME: Mermaid
MW_INST_PATH: /var/www/html
MW_DB_PATH: /var/www/data
MW_EXT_PATH: /var/www/html/extensions
steps:
- name: Install SemanticMediaWiki
run: |
COMPOSER=composer.local.json composer require --update-with-dependencies --working-dir ${{ env.MW_INST_PATH }} mediawiki/semantic-media-wiki ${{ matrix.semantic_mediawiki_version }}
composer update --working-dir ${{ env.MW_INST_PATH }}
echo "wfLoadExtension( 'SemanticMediaWiki' );" >> ${{ env.MW_INST_PATH }}/LocalSettings.php
echo "enableSemantics( 'localhost' );" >> ${{ env.MW_INST_PATH }}/LocalSettings.php
tail -n5 ${{ env.MW_INST_PATH }}/LocalSettings.php
php ${{ env.MW_INST_PATH }}/maintenance/update.php --skip-external-dependencies --quick
- name: Checkout Mermaid
uses: actions/checkout@v2
with:
path: ${{ env.EXT_NAME }}
# Setting actions/checkout@v2 path to env.MW_EXT_PATH fails with "Repository path '/var/www/html/extensions' is not under ..."
# See also open PR https://github.com/actions/checkout/pull/388
- name: Move Mermaid
run: |
mkdir -p ${{ env.MW_EXT_PATH }}
mv ${{ env.EXT_NAME }} ${{ env.MW_EXT_PATH }}
- name: Install Mermaid
run: |
COMPOSER=composer.local.json composer require --no-update --working-dir ${{ env.MW_INST_PATH }} mediawiki/mermaid @dev
COMPOSER=composer.local.json composer config repositories.mermaid '{"type": "path", "url": "extensions/Mermaid"}' --working-dir ${{ env.MW_INST_PATH }}
composer update --working-dir ${{ env.MW_INST_PATH }}
echo "wfLoadExtension( '${{ env.EXT_NAME }}' );" >> ${{ env.MW_INST_PATH }}/LocalSettings.php
tail -n5 ${{ env.MW_INST_PATH }}/LocalSettings.php
php ${{ env.MW_INST_PATH }}/maintenance/update.php --quick
- name: Run Tests
run: >
php ${{ env.MW_INST_PATH }}/tests/phpunit/phpunit.php
--configuration ${{ env.MW_EXT_PATH }}/${{ env.EXT_NAME }}
--testdox
if: matrix.coverage == false
- name: Run Tests With Coverage
run: >
php ${{ env.MW_INST_PATH }}/tests/phpunit/phpunit.php
--configuration ${{ env.MW_EXT_PATH }}/${{ env.EXT_NAME }}
--testdox
--coverage-clover ${{ env.MW_INST_PATH }}/docs/coverage.xml
if: matrix.coverage == true
- name: Upload code coverage
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ env.MW_INST_PATH }}/docs/coverage.xml
if: matrix.coverage == true