|
| 1 | +name: Continuous Integration |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + |
| 9 | +env: |
| 10 | + EXTNAME: SummaryToJiraComment |
| 11 | + MW_INSTALL_PATH: ${{ github.workspace }} |
| 12 | + |
| 13 | +jobs: |
| 14 | + style-php: |
| 15 | + name: Code Style (PHP) |
| 16 | + runs-on: ubuntu-latest |
| 17 | + steps: |
| 18 | + - name: Setup PHP |
| 19 | + uses: shivammathur/setup-php@v2 |
| 20 | + with: |
| 21 | + php-version: '8.1' |
| 22 | + extensions: mbstring, intl |
| 23 | + coverage: none |
| 24 | + tools: composer, phpcs, phplint |
| 25 | + - name: Setup Extension |
| 26 | + uses: actions/checkout@v3 |
| 27 | + - name: Setup Composer |
| 28 | + run: composer update |
| 29 | + - name: Lint |
| 30 | + run: phplint -w --exclude=vendor |
| 31 | + - name: PHP Code Sniffer |
| 32 | + run: vendor/bin/phpcs -sp --standard=.phpcs.xml |
| 33 | + |
| 34 | + security: |
| 35 | + name: Static Analysis |
| 36 | + runs-on: ubuntu-latest |
| 37 | + strategy: |
| 38 | + fail-fast: false |
| 39 | + matrix: |
| 40 | + php: [ '8.1' ] |
| 41 | + mediawiki: [ REL1_39, REL1_41, master ] |
| 42 | + steps: |
| 43 | + - name: Setup PHP |
| 44 | + uses: shivammathur/setup-php@v2 |
| 45 | + with: |
| 46 | + php-version: ${{ matrix.php }} |
| 47 | + extensions: mbstring, intl, ast |
| 48 | + coverage: none |
| 49 | + tools: composer |
| 50 | + - name: Setup MediaWiki |
| 51 | + uses: actions/checkout@v3 |
| 52 | + with: |
| 53 | + repository: wikimedia/mediawiki |
| 54 | + ref: ${{ matrix.mediawiki }} |
| 55 | + - name: Setup Extension |
| 56 | + uses: actions/checkout@v3 |
| 57 | + with: |
| 58 | + path: extensions/${{ env.EXTNAME }} |
| 59 | + - name: Setup Composer |
| 60 | + run: | |
| 61 | + echo '{"extra":{"merge-plugin":{"include":["extensions/*/composer.json","skins/*/composer.json"]}}}' > composer.local.json |
| 62 | + composer update |
| 63 | + composer update |
| 64 | + - name: Phan |
| 65 | + run: ./vendor/bin/phan -d extensions/${{ env.EXTNAME }} --minimum-target-php-version=7.4 --long-progress-bar |
| 66 | + |
| 67 | + test: |
| 68 | + name: PHPUnit |
| 69 | + runs-on: ubuntu-latest |
| 70 | + env: |
| 71 | + MW_INSTALL_PATH: ${{ github.workspace }}/mediawiki |
| 72 | + strategy: |
| 73 | + fail-fast: false |
| 74 | + matrix: |
| 75 | + php: ["8.1"] |
| 76 | + mediawiki: [REL1_39] |
| 77 | + steps: |
| 78 | + - name: Setup Extension |
| 79 | + uses: actions/checkout@v3 |
| 80 | + - name: Mediawiki PHPUnit |
| 81 | + uses: wikiteq/mediawiki-phpunit-action@master |
| 82 | + with: |
| 83 | + type: extension |
| 84 | + php: ${{ matrix.php }} |
| 85 | + mwbranch: ${{ matrix.mediawiki }} |
| 86 | + extension: ${{ env.EXTNAME }} |
0 commit comments