feat(siteStats): ✨ always use NumberFormatter for site stats #1469
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: 🔍 CI | |
| on: | |
| schedule: | |
| - cron: "0 0 * * *" | |
| push: | |
| branches: | |
| - "main" | |
| paths-ignore: | |
| - "docs/**" | |
| pull_request: | |
| branches: | |
| - "**" | |
| - "!dependabot/**" | |
| - "!release-please--branches--**" | |
| paths-ignore: | |
| - "docs/**" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| changes: | |
| name: 🤔 Detect changes | |
| runs-on: ubuntu-latest | |
| outputs: | |
| php: ${{ steps.filter.outputs.php_any_changed }} | |
| script: ${{ steps.filter.outputs.script_any_changed }} | |
| stylesheet: ${{ steps.filter.outputs.stylesheet_any_changed }} | |
| i18n: ${{ steps.filter.outputs.i18n_any_changed }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: tj-actions/changed-files@v47 | |
| id: filter | |
| with: | |
| files_yaml: | | |
| php: | |
| - includes/**/*.php | |
| - tests/**/*.php | |
| - skin.json | |
| - composer.json | |
| - composer.lock | |
| - .github/workflows/ci.yml | |
| script: | |
| - resources/**/*.js | |
| - package.json | |
| - package-lock.json | |
| - .eslintrc.json | |
| stylesheet: | |
| - resources/**/*.css | |
| - resources/**/*.less | |
| - skinStyles/**/*.css | |
| - skinStyles/**/*.less | |
| - package.json | |
| - package-lock.json | |
| i18n: | |
| - i18n/*.json | |
| - package.json | |
| - package-lock.json | |
| lint: | |
| name: 🩹 Lint | |
| needs: changes | |
| timeout-minutes: 10 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. | |
| - name: Cache dependencies | |
| uses: actions/cache@v5 | |
| with: | |
| path: /home/runner/cache | |
| key: ${{ runner.os }}-${{ hashFiles('**/*.lock') }} | |
| - name: Install PHP dependencies | |
| if: needs.changes.outputs.php == 'true' | |
| run: | | |
| composer validate | |
| composer install --prefer-dist --no-progress | |
| - name: Install Node dependencies | |
| if: needs.changes.outputs.script == 'true' || needs.changes.outputs.stylesheet == 'true' || needs.changes.outputs.i18n == 'true' | |
| run: npm ci | |
| - name: Lint PHP | |
| if: needs.changes.outputs.php == 'true' | |
| run: | | |
| composer test | |
| - name: Lint script | |
| if: needs.changes.outputs.script == 'true' | |
| run: | | |
| npm run lint:js | |
| - name: Lint stylesheet | |
| if: needs.changes.outputs.stylesheet == 'true' | |
| run: | | |
| npm run lint:styles | |
| - name: Lint i18n | |
| if: needs.changes.outputs.i18n == 'true' | |
| run: | | |
| npm run lint:i18n | |
| test-php: | |
| name: "🧪 Test PHP (MW ${{ matrix.mw }}, PHP ${{ matrix.php }})" | |
| needs: changes | |
| if: needs.changes.outputs.php == 'true' || github.event_name == 'schedule' | |
| continue-on-error: ${{ matrix.experimental }} | |
| timeout-minutes: 30 | |
| strategy: | |
| matrix: | |
| include: | |
| - mw: "REL1_43" | |
| php: 8.2 | |
| coverage: xdebug | |
| experimental: false | |
| - mw: "REL1_44" | |
| php: 8.3 | |
| coverage: none | |
| experimental: false | |
| - mw: "REL1_45" | |
| php: 8.4 | |
| coverage: none | |
| experimental: false | |
| - mw: "master" | |
| php: 8.5 | |
| coverage: none | |
| 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 }} | |
| coverage: ${{ matrix.coverage }} | |
| extensions: mbstring, intl | |
| tools: composer | |
| - name: Cache MediaWiki | |
| id: cache-mediawiki | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| mediawiki | |
| !mediawiki/extensions/ | |
| !mediawiki/skins/ | |
| !mediawiki/vendor/ | |
| mediawiki/phpunit.xml.dist | |
| key: mw_${{ matrix.mw }}-php${{ matrix.php }}-v27 | |
| - name: Cache Composer cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.composer/cache | |
| key: composer-php${{ matrix.php }} | |
| - uses: actions/checkout@v6 | |
| 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@v6 | |
| with: | |
| path: mediawiki/skins/Citizen | |
| fetch-depth: 0 | |
| - name: Install dependencies with Composer | |
| run: composer update --no-ansi --no-interaction --no-progress | |
| - name: Run tests with PHPUnit | |
| if: ${{ matrix.coverage == 'none' }} | |
| run: composer phpunit:entrypoint -- skins/Citizen | |
| - name: Run tests with PHPUnit with coverage | |
| if: ${{ matrix.coverage == 'xdebug' }} | |
| run: | | |
| composer phpunit:coverage-edit -- skins/Citizen | |
| XDEBUG_MODE=coverage composer phpunit -- --testsuite skins --coverage-clover skins/Citizen/coverage/php/coverage.xml skins/Citizen/tests/phpunit --exclude-group Stub | |
| - name: Scan with SonarQube | |
| uses: sonarsource/sonarqube-scan-action@v7 | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| # Only one once | |
| if: ${{ matrix.coverage == 'xdebug' && env.SONAR_TOKEN != '' }} | |
| with: | |
| projectBaseDir: mediawiki/skins/Citizen |