|
5 | 5 | branches: [ master ] |
6 | 6 | pull_request: |
7 | 7 | branches: [ "*" ] |
| 8 | + workflow_dispatch: |
8 | 9 |
|
9 | 10 | jobs: |
| 11 | + |
10 | 12 | test: |
11 | | - name: "PHPUnit: MW ${{ matrix.mw }}, PHP ${{ matrix.php }} (TYPE ${{ matrix.type }})" |
| 13 | + |
| 14 | + runs-on: ubuntu-latest |
| 15 | + continue-on-error: ${{ matrix.experimental }} |
12 | 16 |
|
13 | 17 | strategy: |
14 | 18 | matrix: |
15 | 19 | include: |
16 | | - - mw: 'REL1_39' |
17 | | - php: 7.4 |
18 | | - type: normal |
19 | | - experimental: false |
20 | | - - mw: 'REL1_39' |
21 | | - php: 8.0 |
22 | | - type: coverage |
| 20 | + - mediawiki_version: '1.39' |
| 21 | + smw_version: dev-master |
| 22 | + php_version: 8.1 |
| 23 | + database_type: mysql |
| 24 | + database_image: "mariadb:10" |
| 25 | + coverage: false |
23 | 26 | experimental: false |
24 | | - - mw: 'REL1_39' |
25 | | - php: 8.1 |
26 | | - type: normal |
| 27 | + - mediawiki_version: '1.40' |
| 28 | + smw_version: dev-master |
| 29 | + php_version: 8.1 |
| 30 | + database_type: mysql |
| 31 | + database_image: "mariadb:11.2" |
| 32 | + coverage: true |
27 | 33 | experimental: false |
28 | | - - mw: 'REL1_40' |
29 | | - php: 8.1 |
30 | | - type: normal |
| 34 | + - mediawiki_version: '1.41' |
| 35 | + smw_version: dev-master |
| 36 | + php_version: 8.1 |
| 37 | + database_type: mysql |
| 38 | + database_image: "mariadb:11.2" |
| 39 | + coverage: false |
31 | 40 | experimental: false |
32 | | - - mw: 'REL1_41' |
33 | | - php: 8.1 |
34 | | - type: normal |
| 41 | + - mediawiki_version: '1.42' |
| 42 | + smw_version: dev-master |
| 43 | + php_version: 8.1 |
| 44 | + database_type: mysql |
| 45 | + database_image: "mariadb:11.2" |
| 46 | + coverage: false |
35 | 47 | experimental: false |
36 | | - - mw: 'REL1_42' |
37 | | - php: 8.2 |
38 | | - type: normal |
| 48 | + - mediawiki_version: '1.43' |
| 49 | + smw_version: dev-master |
| 50 | + php_version: 8.1 |
| 51 | + database_type: mysql |
| 52 | + database_image: "mariadb:11.2" |
| 53 | + coverage: false |
39 | 54 | experimental: false |
40 | | - - mw: 'master' |
41 | | - php: 8.3 |
42 | | - type: normal |
43 | | - experimental: true |
44 | | - |
45 | | - runs-on: ubuntu-latest |
46 | | - continue-on-error: ${{ matrix.experimental }} |
47 | | - |
48 | | - defaults: |
49 | | - run: |
50 | | - working-directory: mediawiki |
51 | 55 |
|
52 | 56 | env: |
53 | | - MW_ROOT: mediawiki |
54 | | - TYPE: ${{ matrix.type }} |
55 | | - |
| 57 | + MW_VERSION: ${{ matrix.mediawiki_version }} |
| 58 | + SMW_VERSION: ${{ matrix.smw_version }} |
| 59 | + PHP_VERSION: ${{ matrix.php_version }} |
| 60 | + DB_TYPE: ${{ matrix.database_type }} |
| 61 | + DB_IMAGE: ${{ matrix.database_image }} |
56 | 62 |
|
57 | 63 | steps: |
58 | | - - name: Setup PHP |
59 | | - uses: shivammathur/setup-php@v2 |
| 64 | + - name: Checkout |
| 65 | + uses: actions/checkout@v4 |
60 | 66 | with: |
61 | | - php-version: ${{ matrix.php }} |
62 | | - extensions: mbstring, intl |
63 | | - tools: composer |
| 67 | + submodules: recursive |
64 | 68 |
|
65 | | - - name: Cache MediaWiki |
66 | | - id: cache-mediawiki |
67 | | - uses: actions/cache@v4 |
68 | | - with: |
69 | | - path: | |
70 | | - mediawiki |
71 | | - !mediawiki/extensions/ |
72 | | - !mediawiki/vendor/ |
73 | | - key: mw_${{ matrix.mw }}-php${{ matrix.php }} |
| 69 | + - name: Update submodules |
| 70 | + run: git submodule update --init --remote |
74 | 71 |
|
75 | | - - name: Cache Composer cache |
76 | | - uses: actions/cache@v4 |
77 | | - with: |
78 | | - path: ~/.composer/cache |
79 | | - key: composer-php${{ matrix.php }} |
| 72 | + - name: Run tests |
| 73 | + run: make ci |
| 74 | + if: matrix.coverage == false |
80 | 75 |
|
81 | | - - uses: actions/checkout@v4 |
82 | | - with: |
83 | | - path: EarlyCopy |
| 76 | + - name: Run tests with coverage |
| 77 | + run: make ci-coverage |
| 78 | + if: matrix.coverage == true |
84 | 79 |
|
85 | | - - name: Install MediaWiki |
86 | | - if: steps.cache-mediawiki.outputs.cache-hit != 'true' |
87 | | - working-directory: ~ |
88 | | - run: bash EarlyCopy/.github/workflows/installWiki.sh ${{ matrix.mw }} SemanticScribunto |
89 | | - |
90 | | - - uses: actions/checkout@v4 |
| 80 | + - name: Upload code coverage |
| 81 | + uses: codecov/codecov-action@v4 |
91 | 82 | with: |
92 | | - path: mediawiki/extensions/SemanticScribunto |
93 | | - |
94 | | - - name: Composer update |
95 | | - run: composer update |
96 | | - |
97 | | - - name: run update.php |
98 | | - run: php maintenance/update.php --quick |
99 | | - |
100 | | - - if: env.TYPE != 'coverage' |
101 | | - name: Run PHPUnit w/o coverage |
102 | | - run: php tests/phpunit/phpunit.php -c extensions/SemanticScribunto/ --testsuite semantic-scribunto-unit |
103 | | - |
104 | | - - if: env.TYPE == 'coverage' |
105 | | - name: Run PHPUnit w/ coverage |
106 | | - run: php tests/phpunit/phpunit.php -c extensions/SemanticScribunto/ --testsuite semantic-scribunto-unit --coverage-clover coverage.clover |
107 | | - |
108 | | - - if: env.TYPE == 'coverage' |
109 | | - name: upload coverage report |
110 | | - working-directory: ~ |
111 | | - run: bash EarlyCopy/.github/workflows/uploadCoverageReport.sh |
| 83 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 84 | + files: coverage/php/coverage.xml |
| 85 | + if: matrix.coverage == true |
0 commit comments