Skip to content

fix(core): 🐛 style issues when calc(breakpoint -1px) < viewport_width < breakpoint #1154

fix(core): 🐛 style issues when calc(breakpoint -1px) < viewport_width < breakpoint

fix(core): 🐛 style issues when calc(breakpoint -1px) < viewport_width < breakpoint #1154

Workflow file for this run

name: 🔍 CI
on:
push:
branches:
- "main"
pull_request:
branches:
- "**"
- "!dependabot/**"
- "!release-please--branches--**"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: 🩹 Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
- name: Cache dependencies
uses: actions/cache@v4
with:
path: /home/runner/cache
key: ${{ runner.os }}-${{ hashFiles('**/*.lock') }}
- name: Install dependencies
run: |
composer validate
composer install --prefer-dist --no-progress
npm ci
# Check for changed files
- name: Check for PHP changes
id: changed-php
uses: tj-actions/changed-files@v47
with:
since_last_remote_commit: "true"
files: |
includes/**/*.php
tests/**/*.php
- name: Check for script changes
id: changed-script
uses: tj-actions/changed-files@v47
with:
since_last_remote_commit: "true"
files: |
resources/**/*.js
- name: Check for stylesheet changes
id: changed-stylesheet
uses: tj-actions/changed-files@v47
with:
since_last_remote_commit: "true"
files: |
resources/**/*.css
resources/**/*.less
skinStyles/**/*.css
skinStyles/**/*.less
- name: Check for i18n changes
id: changed-i18n
uses: tj-actions/changed-files@v47
with:
since_last_remote_commit: "true"
files: |
i18n/*.json
# Bypass the phpcbf non-standard exit code
- name: Lint PHP
if: steps.changed-php.outputs.any_changed == 'true'
continue-on-error: true
run: |
sh ./bin/phpcbf.sh
composer fix
composer test
- name: Lint script
if: steps.changed-script.outputs.any_changed == 'true'
continue-on-error: true
run: |
npm run lint:fix:js
npm run lint:js
- name: Lint stylesheet
if: steps.changed-stylesheet.outputs.any_changed == 'true'
continue-on-error: true
run: |
npm run lint:fix:styles
npm run lint:styles
- name: Lint i18n
if: steps.changed-i18n.outputs.any_changed == 'true'
continue-on-error: true
run: |
npm run lint:i18n
# Only patch code when it is a push event
- name: Push the changes
if: github.event_name == 'push'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if ! git diff --exit-code --quiet; then
git config --global user.name "github-actions"
git config --global user.email "github-actions@users.noreply.github.com"
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git add .
git commit -am "ci: 👷 lint code to MediaWiki standards" -m "Check commit and GitHub actions for more details"
git pull --rebase
git push
else
echo "No changes to commit"
fi
test-php:
name: "🧪 PHP tests: MW ${{ matrix.mw }}, PHP ${{ matrix.php }}"
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
include:
- mw: "REL1_43"
php: 8.2
coverage: xdebug
experimental: false
- mw: "REL1_44"
php: 8.3
coverage: none
experimental: false
- mw: "master"
php: 8.4
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@v4
with:
path: |
mediawiki
!mediawiki/extensions/
!mediawiki/vendor/
mediawiki/phpunit.xml.dist
key: mw_${{ matrix.mw }}-php${{ matrix.php }}-v24
- name: Cache Composer cache
uses: actions/cache@v4
with:
path: ~/.composer/cache
key: composer-php${{ matrix.php }}
- uses: actions/checkout@v5
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@v5
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@v6
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# Only one once
if: ${{ matrix.coverage == 'xdebug' && env.SONAR_TOKEN != '' }}
with:
projectBaseDir: mediawiki/skins/Citizen