You've already forked hackerlibultra
mirror of
https://github.com/HackerN64/hackerlibultra.git
synced 2026-01-21 10:37:53 -08:00
Explicitly use clang-format 19 in CI, reintroduce auto format checks for include/ (#7)
* test clang v19 * require clang-format 19 * Try outputting patch as an artifact * test CI * actually set the correct filename * only upload on failure * try a more descriptive name * remove intentional test change --------- Co-authored-by: someone2639 <someone2639@gmail.com>
This commit is contained in:
10
.github/workflows/ci_gcc.yml
vendored
10
.github/workflows/ci_gcc.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
|
||||
- name: Install package requirements
|
||||
run: sudo apt-get install -y clang-tools clang-format clang-tidy gcc-mips-linux-gnu binutils-mips-linux-gnu build-essential python3
|
||||
run: sudo apt-get install -y clang-tools-19 clang-format-19 clang-tidy-19 gcc-mips-linux-gnu binutils-mips-linux-gnu build-essential python3
|
||||
|
||||
- name: Verify formatting on all files
|
||||
run: python3 tools/check_format.py --verbose
|
||||
@@ -33,3 +33,11 @@ jobs:
|
||||
|
||||
- name: Build libgultra${{ matrix.suffix }} ${{ matrix.version }}
|
||||
run: make -j $(nproc) TARGET=libgultra${{ matrix.suffix }} VERSION=${{ matrix.version }}
|
||||
|
||||
- name: 'Upload Artifact'
|
||||
uses: actions/upload-artifact@v4
|
||||
if: failure()
|
||||
with:
|
||||
name: 'Changes to Apply'
|
||||
path: changes.patch
|
||||
retention-days: 5
|
||||
|
||||
@@ -16,7 +16,7 @@ from typing import List
|
||||
|
||||
# clang-format, clang-tidy and clang-apply-replacements default version
|
||||
# This specific version is used when available, for more consistency between contributors
|
||||
CLANG_VER = 14
|
||||
CLANG_VER = 19
|
||||
|
||||
# Clang-Format options (see .clang-format for rules applied)
|
||||
FORMAT_OPTS = "-i -style=file"
|
||||
@@ -122,7 +122,7 @@ def format_files(src_files: List[str], extra_files: List[str], nb_jobs: int):
|
||||
print("Formatting files with a single job (consider using -j to make this faster)")
|
||||
|
||||
# Format files in chunks to improve performance while still utilizing jobs
|
||||
file_chunks = list(list_chunks(src_files, (len(src_files) // nb_jobs) + 1))
|
||||
file_chunks = list(list_chunks(src_files + extra_files, (len(src_files + extra_files) // nb_jobs) + 1))
|
||||
|
||||
print("Running clang-format...")
|
||||
# clang-format only applies changes in the given files, so it's safe to run in parallel
|
||||
|
||||
@@ -74,7 +74,8 @@ def main():
|
||||
):
|
||||
print(l)
|
||||
|
||||
print(subprocess.check_output("git diff".split(), text=True))
|
||||
with open("changes.patch", "w+") as patchf:
|
||||
patchf.write(subprocess.check_output("git diff".split(), text=True))
|
||||
exit(1)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user