From 4552505082014b941cff671708a9acf852a681f1 Mon Sep 17 00:00:00 2001 From: Ramen2X Date: Wed, 25 Dec 2024 14:59:07 -0500 Subject: [PATCH] Revert "Update actions (#1275)" This reverts commit 457300ddba0c08754743451c90e1b58c6f8e4449. --- .github/workflows/analyze.yml | 27 ++-- .github/workflows/build.yml | 268 ++++++++++++++++------------------ .github/workflows/format.yml | 22 ++- .github/workflows/legobin.yml | 42 +++--- .github/workflows/naming.yml | 71 +++++---- 5 files changed, 203 insertions(+), 227 deletions(-) diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml index 8dd32385..2a25072a 100644 --- a/.github/workflows/analyze.yml +++ b/.github/workflows/analyze.yml @@ -1,9 +1,6 @@ name: Analyze -on: - push: - pull_request: - workflow_dispatch: +on: [push, pull_request] jobs: decomplint-isle: @@ -18,18 +15,16 @@ jobs: - LEGO1 steps: - - name: Checkout repository - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: '3.13' + - uses: actions/setup-python@v5 + with: + python-version: '3.12' - - name: Setup Python modules - run: | - pip install -r tools/requirements.txt + - name: Install python libraries + run: | + pip install -r tools/requirements.txt - - name: Run decomplint.py - run: | - reccmp-decomplint ${{ matrix.who }} --module ${{ matrix.who }} --warnfail + - name: Run decomplint.py + run: | + reccmp-decomplint ${{ matrix.who }} --module ${{ matrix.who }} --warnfail diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a8d74d24..52b9958a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,9 +1,6 @@ name: Build -on: - push: - pull_request: - workflow_dispatch: +on: [push, pull_request] jobs: fetch-deps: @@ -20,15 +17,12 @@ jobs: fail-fast: false matrix: toolchain: - - { name: 'MSVC', shell: 'sh', setup-cmake: true, setup-ninja: true, setup-msvc: true } - - { name: 'msys2 mingw32', shell: 'msys2 {0}', msystem: mingw32, msys-env: mingw-w64-i686, clang-tidy: true, werror: true } - - { name: 'msys2 clang32', shell: 'msys2 {0}', msystem: clang32, msys-env: mingw-w64-clang-i686, clang-tidy: true, werror: true, no-dx5-libs: true } + - { name: 'MSVC', shell: 'sh', setup-cmake: true, setup-ninja: true, setup-msvc: true } + - { name: 'msys2 mingw32', shell: 'msys2 {0}', msystem: mingw32, msys-env: mingw-w64-i686, clang-tidy: true, werror: true } + - { name: 'msys2 clang32', shell: 'msys2 {0}', msystem: clang32, msys-env: mingw-w64-clang-i686, clang-tidy: true, werror: true, no-dx5-libs: true } steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Setup MSYS2 + - name: Set up MSYS2 if: ${{ !!matrix.toolchain.msystem }} uses: msys2/setup-msys2@v2 with: @@ -39,19 +33,21 @@ jobs: ${{ matrix.toolchain.msys-env }}-ninja ${{ matrix.toolchain.msys-env }}-clang-tools-extra - - name: Setup CMake + - name: Setup cmake if: matrix.toolchain.setup-cmake uses: jwlawson/actions-setup-cmake@v2 - name: Setup ninja if: matrix.toolchain.setup-ninja - uses: larziwau/gha-setup-ninja@master + uses: ashutoshvarma/setup-ninja@master - name: Setup vcvars if: matrix.toolchain.setup-msvc uses: ilammy/msvc-dev-cmd@v1 with: - arch: amd64_x86 + arch: amd64_x86 # Use the 64-bit x64-native cross tools to build 32-bit x86 code + + - uses: actions/checkout@v4 - name: Build run: | @@ -64,129 +60,126 @@ jobs: cmake --build build -- -k0 build: - name: MSVC 4.20 + name: 'MSVC 4.20' runs-on: windows-latest steps: - - name: Checkout repository - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Checkout MSVC repository - uses: actions/checkout@v4 - with: - repository: itsmattkc/MSVC420 - path: msvc420 + - uses: actions/checkout@v4 + with: + repository: itsmattkc/msvc420 + path: msvc420 - - name: Setup CMake - uses: jwlawson/actions-setup-cmake@v2 - with: - cmake-version: '3.31.x' + - name: Setup cmake + uses: jwlawson/actions-setup-cmake@v2 + with: + # Use minimum supported version + cmake-version: '3.15.x' - - name: Patch MSVC - run: | - tools/patch_c2.py msvc420/bin/C2.EXE + - name: Patch MSVC 4.2 + run: | + tools/patch_c2.py msvc420/bin/C2.EXE - - name: Build - shell: cmd - run: | - call .\msvc420\bin\VCVARS32.BAT x86 - cmake -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -G "NMake Makefiles" - cmake --build build + - name: Build + shell: cmd + run: | + call .\msvc420\bin\VCVARS32.BAT x86 + cmake -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -G "NMake Makefiles" + cmake --build build - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: Win32 - path: | - build/CONFIG.EXE - build/CONFIG.PDB - build/ISLE.EXE - build/ISLE.PDB - build/LEGO1.DLL - build/LEGO1.PDB + - name: Upload Artifact + uses: actions/upload-artifact@main + with: + name: Win32 + path: | + build/CONFIG.EXE + build/CONFIG.PDB + build/ISLE.EXE + build/ISLE.PDB + build/LEGO1.DLL + build/LEGO1.PDB compare: name: Compare with master needs: [build, fetch-deps] runs-on: windows-latest steps: - - name: Checkout repository - uses: actions/checkout@v4 + - uses: actions/checkout@main - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: '3.13' + - uses: actions/setup-python@v5 + with: + python-version: '3.12' - - name: Download artifact - uses: actions/download-artifact@v4 - with: - name: Win32 - path: build + - uses: actions/download-artifact@main + with: + name: Win32 + path: build - - name: Restore cached original binaries - id: cache-original-binaries - uses: actions/cache/restore@v4 - with: - enableCrossOsArchive: true - path: legobin - key: legobin + - name: Restore cached original binaries + id: cache-original-binaries + uses: actions/cache/restore@v4 + with: + enableCrossOsArchive: true + path: legobin + key: legobin - - name: Setup Python modules - shell: bash - run: | - pip install -r tools/requirements.txt + - name: Install python packages + shell: bash + run: | + pip install -r tools/requirements.txt - - name: Detect binaries - run: | - reccmp-project detect --what original --search-path legobin - reccmp-project detect --what recompiled --search-path build + - name: Detect binaries + run: | + reccmp-project detect --what original --search-path legobin + reccmp-project detect --what recompiled --search-path build - - name: Summarize accuracy - shell: bash - run: | - reccmp-reccmp -S CONFIGPROGRESS.SVG --svg-icon assets/config.png --target CONFIG | tee CONFIGPROGRESS.TXT - reccmp-reccmp -S ISLEPROGRESS.SVG --svg-icon assets/isle.png --target ISLE | tee ISLEPROGRESS.TXT - reccmp-reccmp -S LEGO1PROGRESS.SVG --svg-icon assets/lego1.png --target LEGO1 | tee LEGO1PROGRESS.TXT + - name: Summarize Accuracy + shell: bash + run: | + reccmp-reccmp -S CONFIGPROGRESS.SVG --svg-icon assets/config.png --target CONFIG | tee CONFIGPROGRESS.TXT + reccmp-reccmp -S ISLEPROGRESS.SVG --svg-icon assets/isle.png --target ISLE | tee ISLEPROGRESS.TXT + reccmp-reccmp -S LEGO1PROGRESS.SVG --svg-icon assets/lego1.png --target LEGO1 | tee LEGO1PROGRESS.TXT - - name: Compare accuracy with current master - shell: bash - run: | - curl -fLSs -o CONFIGPROGRESS-OLD.TXT https://github.com/isledecomp/isle/releases/download/continuous/CONFIGPROGRESS.TXT || echo "" >CONFIGPROGRESS-OLD.TXT - curl -fLSs -o ISLEPROGRESS-OLD.TXT https://github.com/isledecomp/isle/releases/download/continuous/ISLEPROGRESS.TXT || echo "" >ISLEPROGRESS-OLD.TXT - curl -fLSs -o LEGO1PROGRESS-OLD.TXT https://github.com/isledecomp/isle/releases/download/continuous/LEGO1PROGRESS.TXT || echo "" >LEGO1PROGRESS-OLD.TXT + - name: Compare Accuracy With Current Master + shell: bash + run: | + # Compare with current master + curl -fLSs -o CONFIGPROGRESS-OLD.TXT https://github.com/isledecomp/isle/releases/download/continuous/CONFIGPROGRESS.TXT || echo "" >CONFIGPROGRESS-OLD.TXT + curl -fLSs -o ISLEPROGRESS-OLD.TXT https://github.com/isledecomp/isle/releases/download/continuous/ISLEPROGRESS.TXT || echo "" >ISLEPROGRESS-OLD.TXT + curl -fLSs -o LEGO1PROGRESS-OLD.TXT https://github.com/isledecomp/isle/releases/download/continuous/LEGO1PROGRESS.TXT || echo "" >LEGO1PROGRESS-OLD.TXT - diff -u0 CONFIGPROGRESS-OLD.TXT CONFIGPROGRESS.TXT || true - diff -u0 ISLEPROGRESS-OLD.TXT ISLEPROGRESS.TXT || true - diff -u0 LEGO1PROGRESS-OLD.TXT LEGO1PROGRESS.TXT || true + diff -u0 CONFIGPROGRESS-OLD.TXT CONFIGPROGRESS.TXT || true + diff -u0 ISLEPROGRESS-OLD.TXT ISLEPROGRESS.TXT || true + diff -u0 LEGO1PROGRESS-OLD.TXT LEGO1PROGRESS.TXT || true - - name: Test exports - shell: bash - run: | - reccmp-verexp --target LEGO1 + - name: Test Exports + shell: bash + run: | + reccmp-verexp --target LEGO1 - - name: Check vtables - shell: bash - run: | - reccmp-vtable --target CONFIG - reccmp-vtable --target ISLE - reccmp-vtable --target LEGO1 + - name: Check Vtables + shell: bash + run: | + reccmp-vtable --target CONFIG + reccmp-vtable --target ISLE + reccmp-vtable --target LEGO1 - - name: Check variables - shell: bash - run: | - reccmp-datacmp --target CONFIG - reccmp-datacmp --target ISLE - reccmp-datacmp --target LEGO1 + - name: Check Variables + shell: bash + run: | + reccmp-datacmp --target CONFIG + reccmp-datacmp --target ISLE + reccmp-datacmp --target LEGO1 - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: Accuracy Report - path: | - CONFIGPROGRESS.* - ISLEPROGRESS.* - LEGO1PROGRESS.* + - name: Upload Artifact + uses: actions/upload-artifact@main + with: + name: Accuracy Report + path: | + CONFIGPROGRESS.* + ISLEPROGRESS.* + LEGO1PROGRESS.* upload: name: Upload artifacts @@ -194,35 +187,32 @@ jobs: runs-on: ubuntu-latest if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'isledecomp/isle' }} steps: - - name: Checkout uploadtool repository - uses: actions/checkout@v4 - with: - repository: probonopd/uploadtool + - uses: actions/checkout@v4 + with: + repository: probonopd/uploadtool - - name: Download build artifact - uses: actions/download-artifact@v4 - with: - name: Win32 - path: build + - uses: actions/download-artifact@main + with: + name: Win32 + path: build - - name: Download accuracy report artifact - uses: actions/download-artifact@v4 - with: - name: Accuracy Report + - uses: actions/download-artifact@main + with: + name: Accuracy Report - - name: Upload continuous release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - UPLOAD_KEY: ${{ secrets.UPLOAD_KEY }} - run: | - ./upload.sh \ - build/CONFIG.EXE \ - build/ISLE.EXE \ - build/LEGO1.DLL \ - CONFIGPROGRESS.* \ - ISLEPROGRESS.* \ - LEGO1PROGRESS.* + - name: Upload Continuous Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + UPLOAD_KEY: ${{ secrets.UPLOAD_KEY }} + run: | + ./upload.sh \ + build/CONFIG.EXE \ + build/ISLE.EXE \ + build/LEGO1.DLL \ + CONFIGPROGRESS.* \ + ISLEPROGRESS.* \ + LEGO1PROGRESS.* - curl -X POST -F key=$UPLOAD_KEY -F 'file=@CONFIGPROGRESS.SVG' https://legoisland.org/progress/ - 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/ + curl -X POST -F key=$UPLOAD_KEY -F 'file=@CONFIGPROGRESS.SVG' https://legoisland.org/progress/ + 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 cbbac4b6..74424665 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -1,9 +1,6 @@ name: Format -on: - push: - pull_request: - workflow_dispatch: +on: [push, pull_request] jobs: clang-format: @@ -11,13 +8,12 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Run clang-format - run: | - find CONFIG LEGO1 ISLE -iname '*.h' -o -iname '*.cpp' | xargs \ - pipx run "clang-format>=17,<18" \ - --style=file \ - -i - git diff --exit-code + - name: Run clang-format + run: | + find CONFIG LEGO1 ISLE -iname '*.h' -o -iname '*.cpp' | xargs \ + pipx run "clang-format>=17,<18" \ + --style=file \ + -i + git diff --exit-code diff --git a/.github/workflows/legobin.yml b/.github/workflows/legobin.yml index 152becff..0fcf175f 100644 --- a/.github/workflows/legobin.yml +++ b/.github/workflows/legobin.yml @@ -2,31 +2,31 @@ name: Download legobin on: workflow_call: - workflow_dispatch: jobs: fetch: runs-on: ubuntu-latest steps: - - name: Restore cached original binaries - id: cache-original-binaries - uses: actions/cache/restore@v4 - with: - enableCrossOsArchive: true - path: legobin - key: legobin - - name: Download original Island binaries - if: ${{ !steps.cache-original-binaries.outputs.cache-hit }} - run: | - wget https://legoisland.org/download/CONFIG.EXE --directory-prefix=legobin - wget https://legoisland.org/download/ISLE.EXE --directory-prefix=legobin - wget https://legoisland.org/download/LEGO1.DLL --directory-prefix=legobin + - name: Restore cached original binaries + id: cache-original-binaries + uses: actions/cache/restore@v4 + with: + enableCrossOsArchive: true + path: legobin + key: legobin - - name: Cache original binaries - if: ${{ !steps.cache-original-binaries.outputs.cache-hit }} - uses: actions/cache/save@v4 - with: - enableCrossOsArchive: true - path: legobin - key: legobin + - name: Download original island binaries + if: ${{ !steps.cache-original-binaries.outputs.cache-hit }} + run: | + wget https://legoisland.org/download/CONFIG.EXE --directory-prefix=legobin + wget https://legoisland.org/download/ISLE.EXE --directory-prefix=legobin + wget https://legoisland.org/download/LEGO1.DLL --directory-prefix=legobin + + - name: Cache original binaries + if: ${{ !steps.cache-original-binaries.outputs.cache-hit }} + uses: actions/cache/save@v4 + with: + enableCrossOsArchive: true + path: legobin + key: legobin diff --git a/.github/workflows/naming.yml b/.github/workflows/naming.yml index 4503c74c..15d57553 100644 --- a/.github/workflows/naming.yml +++ b/.github/workflows/naming.yml @@ -1,9 +1,6 @@ name: Naming -on: - push: - pull_request: - workflow_dispatch: +on: [push, pull_request] jobs: ncc: @@ -11,42 +8,40 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Setup LLVM and Clang - uses: KyleMayes/install-llvm-action@v2 - with: - version: '16' + - name: Install LLVM and Clang + uses: KyleMayes/install-llvm-action@v2 + with: + version: '16' - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: '3.13' + - uses: actions/setup-python@v5 + with: + python-version: '3.12' - - name: Setup Python modules - run: | - pip install -r tools/requirements.txt + - name: Install python libraries + run: | + pip install -r tools/requirements.txt - - name: Run ncc - run: | - action_headers=$(find LEGO1/lego/legoomni/include/actions \ - -name '*.h' -print0 | xargs -0 echo) + - name: Run ncc + run: | + action_headers=$(find LEGO1/lego/legoomni/include/actions \ + -name '*.h' -print0 | xargs -0 echo) - python3 tools/ncc/ncc.py \ - --clang-lib ${{ env.LLVM_PATH }}/lib/libclang.so \ - --recurse \ - --style tools/ncc/ncc.style \ - --skip tools/ncc/skip.yml \ - --definition WINAPI FAR BOOL CALLBACK HWND__=HWND \ - --include \ - util \ - LEGO1 \ - LEGO1/omni/include \ - LEGO1/lego/legoomni/include \ - LEGO1/lego/sources \ - --exclude \ - LEGO1/omni/include/flic.h \ - LEGO1/omni/src/video/flic.cpp \ - $action_headers \ - --path LEGO1/omni LEGO1/lego/legoomni + python3 tools/ncc/ncc.py \ + --clang-lib ${{ env.LLVM_PATH }}/lib/libclang.so \ + --recurse \ + --style tools/ncc/ncc.style \ + --skip tools/ncc/skip.yml \ + --definition WINAPI FAR BOOL CALLBACK HWND__=HWND \ + --include \ + util \ + LEGO1 \ + LEGO1/omni/include \ + LEGO1/lego/legoomni/include \ + LEGO1/lego/sources \ + --exclude \ + LEGO1/omni/include/flic.h \ + LEGO1/omni/src/video/flic.cpp \ + $action_headers \ + --path LEGO1/omni LEGO1/lego/legoomni