mirror of
https://github.com/ihhub/fheroes2.git
synced 2026-10-12 02:16:11 +00:00
42 lines
1.3 KiB
YAML
42 lines
1.3 KiB
YAML
name: Code style check
|
|
|
|
on:
|
|
workflow_call:
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
style:
|
|
name: Code style check
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 10
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 50
|
|
- name: Setup clang-format
|
|
run: |
|
|
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-17 100
|
|
sudo update-alternatives --install /usr/bin/clang-format-diff clang-format-diff /usr/bin/clang-format-diff-17 100
|
|
- name: Check code format
|
|
run: |
|
|
bash script/tools/check_code_format.sh
|
|
- name: Check copyright headers
|
|
run: |
|
|
bash script/tools/check_copyright_headers.sh
|
|
- name: Check LegalCopyright date in fheroes2.rc
|
|
run: |
|
|
(grep "VALUE \"LegalCopyright\", *\"\\\\251 $(date +%Y) fheroes2 Resurrection team" src/resources/fheroes2.rc > /dev/null && \
|
|
echo "The date specified in the LegalCopyright entry is valid.") || \
|
|
(echo "Please update the date in the LegalCopyright entry!" && false)
|
|
- name: Check format of markdown files
|
|
uses: DavidAnson/markdownlint-cli2-action@v19
|
|
- name: Check format of HTML and CSS files
|
|
uses: creyD/[email protected]
|
|
with:
|
|
dry: true
|
|
prettier_options: --write docs/**/*.{html,scss}
|