From d6e91be015b68ef17eafaeedfdebde278cdcc0cf Mon Sep 17 00:00:00 2001 From: tntexplosivesltd Date: Wed, 22 Nov 2023 23:15:16 +1300 Subject: [PATCH] Add black/pylint to github actions --- .github/workflows/build.yml | 14 +++++++------- .github/workflows/format.yml | 16 ++++++++++++++-- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e14f01d8..4ff63621 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,7 +38,7 @@ jobs: build/ISLE.PDB build/LEGO1.DLL build/LEGO1.PDB - + compare: needs: build runs-on: windows-latest @@ -96,7 +96,7 @@ jobs: shell: bash run: | python3 tools/verexp/verexp.py legobin/LEGO1.DLL build/LEGO1.DLL - + - name: Upload Artifact uses: actions/upload-artifact@master with: @@ -104,7 +104,7 @@ jobs: path: | ISLEPROGRESS.* LEGO1PROGRESS.* - + upload: needs: [build, compare] runs-on: ubuntu-latest @@ -113,16 +113,16 @@ jobs: - uses: actions/checkout@v3 with: repository: 'probonopd/uploadtool' - + - uses: actions/download-artifact@master with: name: Win32 path: build - + - uses: actions/download-artifact@master with: name: Accuracy Report - + - name: Upload Continuous Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -133,6 +133,6 @@ jobs: build/LEGO1.DLL \ ISLEPROGRESS.* \ LEGO1PROGRESS.* - + curl -X POST -F key=$UPLOAD_KEY -F 'file=@ISLEPROGRESS.SVG' https://legoisland.org/progress/ curl -X POST -F key=$UPLOAD_KEY -F 'file=@LEGO1PROGRESS.SVG' https://legoisland.org/progress/ diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index ff151342..ad54d7cf 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -3,12 +3,24 @@ name: Format on: [push, pull_request] jobs: - clang-format: + format: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: Build isledecomp library + shell: bash + run: | + pip install black pylint tools/isledecomp + + - name: Run pylint and black + shell: bash + run: | + pip install -r tools/reccmp/requirements.txt + pylint tools + black --check tools + - name: Run clang-format run: | pipx run "clang-format>=17,<18" \ @@ -19,4 +31,4 @@ jobs: LEGO1/*.cpp LEGO1/*.h \ LEGO1/realtime/*.cpp LEGO1/realtime/*.h \ LEGO1/tgl/*.h \ - LEGO1/viewmanager/*.cpp LEGO1/viewmanager/*.h \ No newline at end of file + LEGO1/viewmanager/*.cpp LEGO1/viewmanager/*.h