Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
Aira-Sakuranomiya committed Jun 6, 2024
2 parents 46347af + 3d146b2 commit 6c14562
Show file tree
Hide file tree
Showing 285 changed files with 7,521 additions and 7,465 deletions.
26 changes: 26 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
root = true

[*]
indent_style = tab
indent_size = tab
tab_width = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

# Ensure text editors don't turn leading spaces into tabs,
# e.g. in multi-line bullet list items
[*.md]
indent_style = space
indent_size = 2

# Tabs may not be valid YAML
# @see https://yaml.org/spec/1.2/spec.html#id2777534
[*.{yml,yaml}]
indent_style = space
indent_size = 2

[.git/**]
indent_style = space
indent_size = 2
29 changes: 2 additions & 27 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,6 @@
{
"root": true,
"extends": [
"wikimedia/client-es6",
"wikimedia/mediawiki"
],
"env": {
"browser": true
},
"globals": {
"exports": true
},
"rules": {
"no-implicit-globals": "warn",
"es-x/no-async-functions": "warn",
"es-x/no-object-fromentries": "warn",
"es-x/no-object-entries": "warn",
"es-x/no-object-values": "warn",
"es-x/no-array-prototype-includes": "warn",
"es-x/no-optional-chaining": "warn",
"es-x/no-nullish-coalescing-operators": "warn",
"es-x/no-rest-spread-properties": "warn",
"es-x/no-symbol-prototype-description": "warn",
"compat/compat": "warn",
"mediawiki/class-doc": "off"
},
"parserOptions": {
"ecmaVersion": 11,
"sourceType": "module"
}
"wikimedia/server"
]
}
250 changes: 129 additions & 121 deletions .github/workflows/mediawiki.yml → .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,121 +1,129 @@
name: Lint

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'

jobs:
test:
name: Lint
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['8.2', '8.1', '8.0', '7.4']
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v4
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 install --save-dev
# Check for changed files
- name: Check for PHP changes
id: changed-php
uses: tj-actions/changed-files@v44
with:
since_last_remote_commit: "true"
files: |
includes/**/*.php
- name: Check for script changes
id: changed-script
uses: tj-actions/changed-files@v44
with:
since_last_remote_commit: "true"
files: |
resources/**/*.js
- name: Check for stylesheet changes
id: changed-stylesheet
uses: tj-actions/changed-files@v44
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@v44
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
name: Lint

on:
push:
branches-ignore:
- 'release-please/**'
pull_request:
branches-ignore:
- 'release-please/**'

jobs:
test:
name: Lint
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['8.2', '8.1', '8.0', '7.4']
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v4
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 install --save-dev
# Check for changed files
- name: Check for PHP changes
id: changed-php
uses: tj-actions/changed-files@v44
with:
since_last_remote_commit: "true"
files: |
includes/**/*.php
- name: Check for script changes
id: changed-script
uses: tj-actions/changed-files@v44
with:
since_last_remote_commit: "true"
files: |
resources/**/*.js
- name: Check for stylesheet changes
id: changed-stylesheet
uses: tj-actions/changed-files@v44
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@v44
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
- name: Trigger PHP tests
if: steps.changed-php.outputs.any_changed == 'true'
run: |
curl -X POST -H "Authorization: token ${{ secrets.WORKFLOW_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/StarCitizenTools/mediawiki-skins-Citizen/actions/workflows/php-tests.yaml/dispatches \
-d '{"ref":"main"}'
# 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
9 changes: 3 additions & 6 deletions .github/workflows/ci.yml → .github/workflows/php-tests.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
name: PHP unit test
name: PHP tests

on:
push:
branches: [ main, develop, feature/* ]
pull_request:
branches: [ "*" ]
workflow_dispatch:

jobs:
test:
name: "PHPUnit: MW ${{ matrix.mw }}, PHP ${{ matrix.php }}"
name: "PHP tests: MW ${{ matrix.mw }}, PHP ${{ matrix.php }}"
continue-on-error: ${{ matrix.experimental }}

strategy:
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

name: release-please

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
with:
token: ${{ secrets.WORKFLOW_TOKEN }}
Empty file modified .husky/pre-commit
100755 → 100644
Empty file.
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "2.16.0"
}
1 change: 1 addition & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
],
"rules": {
"font-weight-notation": null,
"selector-class-pattern": null,
"selector-max-id": null,
"no-descending-specificity": null,
"declaration-no-important": null,
Expand Down
Loading

0 comments on commit 6c14562

Please sign in to comment.