fname: decompile a good chunk of code (#3056) #12753
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build PSX and PSP version | |
| on: | |
| push: | |
| branches: | |
| - master | |
| paths-ignore: | |
| - '*.md' | |
| - '**/*.md' | |
| pull_request_target: | |
| paths-ignore: | |
| - '*.md' | |
| - '**/*.md' | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.ref }}-${{ github.job }}-${{ github.event_name }}-${{ github.number }} | |
| cancel-in-progress: false | |
| jobs: | |
| build-and-test: | |
| strategy: | |
| matrix: | |
| version: ["us", "hd", "pspeu"] | |
| include: | |
| - dependency: us | |
| version: us | |
| - dependency: pspeu | |
| version: hd | |
| - dependency: pspeu | |
| version: pspeu | |
| # Building and testing cannot work if the repository owner is not Xeeynamo | |
| # due to the missing secrets to clone the CI dependencies | |
| if: github.repository == 'Xeeynamo/sotn-decomp' | |
| runs-on: ubuntu-latest | |
| env: | |
| VERSION: ${{ matrix.version }} | |
| FROGRESS_API_BASE_URL: ${{ secrets.FROGRESS_API_BASE_URL }} | |
| FROGRESS_API_SECRET: ${{ secrets.FROGRESS_API_SECRET }} | |
| DISCORD_PROGRESS_WEBHOOK: ${{ secrets.DISCORD_PROGRESS_WEBHOOK }} | |
| steps: | |
| - name: Clone main repo (PR) | |
| if: github.event_name == 'pull_request_target' | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| submodules: false | |
| - name: Clone main repo | |
| if: github.event_name != 'pull_request_target' | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.ref }} | |
| submodules: false | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: 'go.work' | |
| cache: true | |
| cache-dependency-path: "**/*.sum" | |
| - name: Install requirements | |
| run: sudo apt-get install gcc-mipsel-linux-gnu | |
| - name: Install tools requirements | |
| run: make update-dependencies | |
| - name: Get dependencies | |
| uses: actions/cache@v4 | |
| id: get-dependencies | |
| with: | |
| path: 'disks/dependencies' | |
| key: sotn-${{ matrix.dependency }}-deps | |
| - name: Get dependencies (uncached) | |
| if: steps.get-dependencies.outputs.cache-hit != 'true' | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: xeeynamo/sotn-decomp-dependencies | |
| ref: ${{ matrix.dependency }} | |
| token: ${{ secrets.SOTN_DECOMP_DEPENDENCIES_TOKEN }} | |
| path: 'disks/dependencies' | |
| - name: Cache dependencies | |
| if: steps.get-dependencies.outputs.cache-hit != 'true' | |
| uses: actions/cache/save@v3 | |
| with: | |
| path: 'disks/dependencies' | |
| key: sotn-${{ matrix.dependency }}-deps | |
| - name: Setting up dependencies | |
| working-directory: disks | |
| run: cat dependencies/* | tar -zxf - | |
| - name: Extract dependencies | |
| run: make extract_disk | |
| - name: Build binaries and check if they match | |
| run: make build | |
| - name: Generate progress report | |
| if: github.ref == 'refs/heads/master' && github.event_name == 'push' | |
| run: make progress-report | |
| - name: Upload progress report | |
| if: github.ref == 'refs/heads/master' && github.event_name == 'push' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.version }}_report | |
| path: build/${{ matrix.version }}/report.json | |
| - name: Remove clutter from build folder | |
| run: rm -rf build/${{ matrix.version }}/asm build/${{ matrix.version }}/src build/${{ matrix.version }}/assets | |
| - name: Export build folder | |
| if: github.ref == 'refs/heads/master' && github.event_name == 'push' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build_${{ matrix.version }} | |
| path: build/${{ matrix.version }} | |
| - name: Report progress (dry run) | |
| if: github.ref != 'refs/heads/master' | |
| run: .venv/bin/python3 tools/progress.py --dry-run --version ${{ matrix.version }} | |
| - name: Report progress (online) | |
| if: github.ref == 'refs/heads/master' && github.event_name == 'push' | |
| run: .venv/bin/python3 tools/progress.py --version ${{ matrix.version }} | |
| generate-duplicates-report: | |
| strategy: | |
| matrix: | |
| version: ["us"] | |
| include: | |
| - dependency: us | |
| version: us | |
| if: github.ref == 'refs/heads/master' && github.event_name == 'push' | |
| needs: build-and-test | |
| runs-on: ubuntu-latest | |
| env: | |
| VERSION: ${{ matrix.version }} | |
| steps: | |
| - name: Install requirements | |
| run: sudo apt-get install gcc-mipsel-linux-gnu | |
| - name: Clone main repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: false | |
| - name: Install tool requirements | |
| run: make update-dependencies | |
| - name: Get dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: 'disks/dependencies' | |
| key: sotn-${{ matrix.dependency }}-deps | |
| - name: Setting up dependencies | |
| working-directory: disks | |
| run: cat dependencies/* | tar -zxf - | |
| - name: Extract dependencies | |
| run: make extract_disk | |
| - name: Obtain built binaries | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: build_${{ matrix.version }} | |
| path: build/${{ matrix.version }} | |
| - name: Clone asset repository | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: 'gh-duplicates' | |
| path: 'gh-duplicates' | |
| - name: Set-up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Install secondary pre-requirements | |
| run: | | |
| make python-dependencies & \ | |
| (sudo apt-get update && sudo apt-get install graphviz) & \ | |
| wait | |
| - name: Generate reports | |
| run: | | |
| make reports | |
| - name: Publish reports | |
| run: | | |
| mkdir -p gh-duplicates | |
| cp -r build/us/reports/* gh-duplicates/ | |
| - name: Commit all reports | |
| run: | | |
| git config --global user.name 'GitHub Action' | |
| git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
| git add -A | |
| git commit -m 'Update reports' || true | |
| git push | |
| working-directory: gh-duplicates | |
| generate-duplicates-report-psp: | |
| strategy: | |
| matrix: | |
| version: ["pspeu"] | |
| include: | |
| - dependency: pspeu | |
| version: pspeu | |
| if: github.ref == 'refs/heads/master' && github.event_name == 'push' | |
| needs: build-and-test | |
| runs-on: ubuntu-latest | |
| env: | |
| VERSION: ${{ matrix.version }} | |
| steps: | |
| - name: Install requirements | |
| run: sudo apt-get install gcc-mipsel-linux-gnu | |
| - name: Clone main repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: false | |
| - name: Install requirements | |
| run: make update-dependencies | |
| - name: Get dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: 'disks/dependencies' | |
| key: sotn-${{ matrix.dependency }}-deps | |
| - name: Setting up dependencies | |
| working-directory: disks | |
| run: cat dependencies/* | tar -zxf - | |
| - name: Extract dependencies | |
| run: make extract_disk | |
| - name: Obtain built binaries | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: build_${{ matrix.version }} | |
| path: build/${{ matrix.version }} | |
| - name: Clone asset repository | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: 'gh-duplicates-${{ matrix.version }}' | |
| path: 'gh-duplicates' | |
| - name: Set-up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Install secondary pre-requirements | |
| run: | | |
| make python-dependencies & | |
| (sudo apt-get update && sudo apt-get install graphviz) & \ | |
| wait | |
| - name: Generate function report | |
| run: | | |
| make clean && make build | |
| find asm -print | |
| .venv/bin/python3 tools/function_finder/function_finder_psp.py --no-fetch > gh-duplicates/functions.md | |
| - name: Commit all reports | |
| run: | | |
| git config --global user.name 'GitHub Action' | |
| git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
| git add -A | |
| git commit -m 'Update reports' || true | |
| git push | |
| working-directory: gh-duplicates |