Revert "Revert "Add docker image labels"" #635
Workflow file for this run
This file contains hidden or 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
| name: NeoWiki CI (PHP) | |
| on: | |
| push: | |
| paths-ignore: | |
| - '.github/workflows/ci-ts.yml' | |
| - '.github/workflows/neo-ci-ts.yml' | |
| - 'resources/**' | |
| - 'Neo/neojs/**' | |
| pull_request: | |
| paths-ignore: | |
| - '.github/workflows/ci-ts.yml' | |
| - '.github/workflows/neo-ci-ts.yml' | |
| - 'resources/**' | |
| - 'Neo/neojs/**' | |
| jobs: | |
| test: | |
| name: "PHPUnit: MW ${{ matrix.mw }}, PHP ${{ matrix.php }}" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - mw: 'REL1_43' | |
| php: '8.3' | |
| runs-on: ubuntu-latest | |
| env: | |
| NEO4J_URL_OVERRIDE: bolt://neo4j:password@localhost:7689 | |
| NEO4J_URL_READ_OVERRIDE: bolt://mediawiki_read:mediawiki_read@localhost:7689 | |
| services: | |
| test_neo: | |
| image: neo4j:enterprise | |
| ports: | |
| - 7689:7689 | |
| - 7475:7475 | |
| env: | |
| NEO4J_ACCEPT_LICENSE_AGREEMENT: eval | |
| NEO4J_AUTH: neo4j/password | |
| NEO4J_server_bolt_listen__address: :7689 | |
| NEO4J_server_http_listen__address: :7475 | |
| options: --name test_neo --hostname test_neo | |
| 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@v4 | |
| with: | |
| path: | | |
| mediawiki | |
| !mediawiki/extensions/ | |
| !mediawiki/vendor/ | |
| key: mw_${{ matrix.mw }}-php${{ matrix.php }} | |
| - name: Cache Composer cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.composer/cache | |
| key: composer-php${{ matrix.php }} | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: EarlyCopy | |
| - name: Install MediaWiki | |
| if: steps.cache-mediawiki.outputs.cache-hit != 'true' | |
| working-directory: ~ | |
| run: bash EarlyCopy/.github/workflows/installMediaWiki.sh ${{ matrix.mw }} NeoWiki | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: mediawiki/extensions/NeoWiki | |
| - run: composer update | |
| - name: Wait for Neo4j | |
| uses: iFaxity/wait-on-action@v1 | |
| with: | |
| resource: http-get://localhost:7689 | |
| timeout: 60000 | |
| - name: Run update.php | |
| run: php maintenance/update.php --quick | |
| - name: Create neo4j user | |
| run: docker exec test_neo bash -c \ | |
| "echo \"CREATE USER mediawiki_read SET PASSWORD 'mediawiki_read' CHANGE NOT REQUIRED; GRANT ROLE reader TO mediawiki_read;\" | cypher-shell -u neo4j -p password -a bolt://localhost:7689" | |
| - name: Run PHPUnit | |
| run: php tests/phpunit/phpunit.php -c extensions/NeoWiki/phpunit.xml.dist | |
| phpcs: | |
| name: "PHPCS with PHP 8.3" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: 8.3 | |
| - name: Checkout NeoExtension | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: composer install | |
| - name: Run PHPCS | |
| run: vendor/bin/phpcs -p -s --standard=phpcs.xml | |
| PHPStan: | |
| name: "PHPStan: MW ${{ matrix.mw }}, PHP ${{ matrix.php }}" | |
| strategy: | |
| matrix: | |
| include: | |
| - mw: 'REL1_43' | |
| php: '8.3' | |
| 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@v4 | |
| with: | |
| path: | | |
| mediawiki | |
| !mediawiki/extensions/ | |
| !mediawiki/vendor/ | |
| key: mw_${{ matrix.mw }}-php${{ matrix.php }} | |
| - name: Cache Composer cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.composer/cache | |
| key: composer-php${{ matrix.php }} | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: EarlyCopy | |
| - name: Install MediaWiki | |
| if: steps.cache-mediawiki.outputs.cache-hit != 'true' | |
| working-directory: ~ | |
| run: bash EarlyCopy/.github/workflows/installMediaWiki.sh ${{ matrix.mw }} NeoWiki | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: mediawiki/extensions/NeoWiki | |
| - run: composer update | |
| - name: Composer install | |
| run: cd extensions/NeoWiki && composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader | |
| - name: PHPStan | |
| run: cd extensions/NeoWiki && vendor/bin/phpstan analyze --configuration=phpstan.neon --memory-limit=2G | |
| # Psalm: | |
| # name: "Psalm: MW ${{ matrix.mw }}, PHP ${{ matrix.php }}" | |
| # | |
| # continue-on-error: true # TODO | |
| # | |
| # strategy: | |
| # matrix: | |
| # include: | |
| # - mw: 'master' | |
| # php: '8.3' | |
| # | |
| # 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@v4 | |
| # with: | |
| # path: | | |
| # mediawiki | |
| # !mediawiki/extensions/ | |
| # !mediawiki/vendor/ | |
| # key: mw_${{ matrix.mw }}-php${{ matrix.php }} | |
| # | |
| # - name: Cache Composer cache | |
| # uses: actions/cache@v4 | |
| # with: | |
| # path: ~/.composer/cache | |
| # key: composer-php${{ matrix.php }} | |
| # | |
| # - uses: actions/checkout@v4 | |
| # with: | |
| # path: EarlyCopy | |
| # | |
| # - name: Install MediaWiki | |
| # if: steps.cache-mediawiki.outputs.cache-hit != 'true' | |
| # working-directory: ~ | |
| # run: bash EarlyCopy/.github/workflows/installMediaWiki.sh ${{ matrix.mw }} NeoWiki | |
| # | |
| # - uses: actions/checkout@v4 | |
| # with: | |
| # path: mediawiki/extensions/NeoWiki | |
| # | |
| # - uses: actions/checkout@v4 | |
| # with: | |
| # repository: ProfessionalWiki/Neo | |
| # path: mediawiki/extensions/NeoWiki/Neo | |
| # token: ${{ secrets.NEO_READ_FPAT }} | |
| # # Expected to expire on Sep 12 2025 | |
| # # https://github.com/organizations/ProfessionalWiki/settings/secrets/actions/NEO_READ_FPAT (enter new value) | |
| # # (Re)generate token with contents read access for Neo and NeoExtension at https://github.com/settings/tokens?type=beta | |
| # | |
| # - run: composer update | |
| # | |
| # - name: Composer install | |
| # run: cd extensions/NeoWiki && composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader | |
| # | |
| # - name: Psalm | |
| # run: cd extensions/NeoWiki && vendor/bin/psalm --config=psalm.xml --no-diff |