use github actions instead (#605)

* Create actions
This commit is contained in:
coco875 2024-04-13 02:54:59 +02:00 committed by GitHub
parent 2d3278d073
commit e2c19fd4bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
17 changed files with 227 additions and 19905 deletions

View File

@ -0,0 +1,54 @@
name: Doxygen GitHub Pages Deploy Action
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.1
with:
submodules: "true"
- name: Get Complementary file
uses: actions/checkout@v4.1.1
with:
path: complementary_file
repository: UnspaghettifyKart/action-build-private-file
ssh-key: ${{ secrets.LINUX_DEPLOY_SSH_PRIVATE_KEY }}
- name: Install dependencies
run: |
sudo apt install build-essential cmake pkg-config git binutils-mips-linux-gnu python3 zlib1g-dev libaudiofile-dev libcapstone-dev
- name: Build
run: |
cp -r complementary_file/* .
echo "${{ secrets.AES_KEY }}" | openssl enc -d -aes-256-cbc -pass stdin -pbkdf2 -in baserom.us.z64.aes -out baserom.us.z64
make assets
make -j
- name: Install Doxygen
run: |
sudo apt-get install graphviz doxygen
wget https://www.doxygen.nl/files/doxygen-1.10.0.linux.bin.tar.gz
tar -xzf doxygen-*.linux.bin.tar.gz
- name: make badge
run: |
pip install pybadges
python3 progress.py badge
- name: Generate Doxygen documentation
run: |
./doxygen-*/bin/doxygen Doxyfile
- name: Create .nojekyll (ensures pages with underscores work on gh pages)
run: touch docs/html/.nojekyll
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: docs/html

View File

@ -1,36 +0,0 @@
name: Doxygen GitHub Pages Deploy Action
on:
push:
branches:
- master
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: "true"
- name: Install Doxygen
run: |
sudo apt-get install graphviz doxygen -y
wget https://www.doxygen.nl/files/doxygen-1.10.0.linux.bin.tar.gz
tar -xzf doxygen-*.linux.bin.tar.gz
- name: Generate Doxygen documentation
run: |
./doxygen-*/bin/doxygen Doxyfile
- name: Create .nojekyll (ensures pages with underscores work on gh pages)
run: touch docs/html/.nojekyll
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: docs/html

30
.github/workflows/linux-compile.yml vendored Normal file
View File

@ -0,0 +1,30 @@
name: Linux Compile test
on:
push:
branches: [ "*" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
with:
submodules: "true"
- name: Get Complementary file
uses: actions/checkout@v4.1.1
with:
path: complementary_file
repository: UnspaghettifyKart/action-build-private-file
ssh-key: ${{ secrets.LINUX_SSH_PRIVATE_KEY }}
- name: Install dependencies
run: |
sudo apt install build-essential cmake pkg-config git binutils-mips-linux-gnu python3 zlib1g-dev libaudiofile-dev libcapstone-dev
- name: Build
run: |
cp -r complementary_file/* .
echo "${{ secrets.AES_KEY }}" | openssl enc -d -aes-256-cbc -pass stdin -pbkdf2 -in baserom.us.z64.aes -out baserom.us.z64
make assets
make -j

32
.github/workflows/macos-compile.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: Macos Compile test
on:
push:
branches: [ "*" ]
pull_request:
branches: [ "master" ]
jobs:
build:
if: 0
runs-on: macos-latest
steps:
- uses: actions/checkout@v4.1.1
with:
submodules: "true"
- name: Get Complementary file
uses: actions/checkout@v4.1.1
with:
path: complementary_file
repository: UnspaghettifyKart/action-build-private-file
ssh-key: ${{ secrets.MACOS_SSH_PRIVATE_KEY }}
- name: Install dependencies
run: |
brew update
brew install python3 capstone coreutils make pkg-config tehzz/n64-dev/mips64-elf-binutils cmake
- name: Build
run: |
cp -r complementary_file/* .
echo "${{ secrets.AES_KEY }}" | openssl enc -d -aes-256-cbc -pass stdin -pbkdf2 -in baserom.us.z64.aes -out baserom.us.z64
make assets
make -j

31
.github/workflows/windows-compile.yml vendored Normal file
View File

@ -0,0 +1,31 @@
name: Windows Compile test
on:
push:
branches: [ "*" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: windows-2022
steps:
- uses: actions/checkout@v4.1.1
with:
submodules: "true"
- name: Get Complementary file
uses: actions/checkout@v4.1.1
with:
path: complementary_file
repository: UnspaghettifyKart/action-build-private-file
ssh-key: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY }}
- name: Install dependencies
run: |
Invoke-WebRequest https://github.com/coco875/mk64-tools/releases/download/v0.0.6/mips-tools-chain-windows.zip -OutFile mips-tools-chain-windows.zip
Expand-Archive mips-tools-chain-windows.zip -DestinationPath mips-tools-chain-windows
Copy-Item -Path mips-tools-chain-windows/mingw64 -Destination tools -Recurse
- name: Build
run: |
Copy-Item -Path complementary_file/* -Destination . -Recurse
echo "${{ secrets.AES_KEY }}" | openssl enc -d -aes-256-cbc -pass stdin -pbkdf2 -in baserom.us.z64.aes -out baserom.us.z64
python tools/windows_build.py

4
.gitignore vendored
View File

@ -93,8 +93,12 @@ expected/*
# Doxygen
docs/html/*
docs/doxygen_syms.md
# windows build
mingw64/
.ash_history
!tools/ido-recomp/*/*
# torch
torch.hash.yml

View File

@ -947,7 +947,7 @@ INPUT = docs/ \
src/ \
include/ \
courses/ \
tools/doxygen_syms.md
docs/doxygen_syms.md
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses

View File

@ -176,7 +176,6 @@ ifeq ($(DUMMY),FAIL)
endif
ifeq ($(filter clean distclean print-%,$(MAKECMDGOALS)),)
# Make tools if out of date
DUMMY != make -C $(TOOLS_DIR)
ifeq ($(DUMMY),FAIL)
@ -356,7 +355,7 @@ BIN2C := $(PYTHON) $(TOOLS_DIR)/bin2c.py
EXTRACT_DATA_FOR_MIO := $(TOOLS_DIR)/extract_data_for_mio
ASSET_EXTRACT := $(PYTHON) $(TOOLS_DIR)/new_extract_assets.py
LINKONLY_GENERATOR := $(PYTHON) $(TOOLS_DIR)/linkonly_generator.py
TORCH := tools/torch/cmake-build-release/torch
TORCH := $(TOOLS_DIR)/torch/cmake-build-release/torch
EMULATOR = mupen64plus
EMU_FLAGS = --noosd
LOADER = loader64

View File

@ -11,24 +11,26 @@ It supports and builds the following versions:
| mk64.eu-1.0.z64 | EUR 1.0 | a729039453210b84f17019dda3f248d5888f7690 |
| mk64.eu-final.z64 | EUR 1.1 | f6b5f519dd57ea59e9f013cc64816e9d273b2329 |
status: [![Linux Compile test](https://github.com/n64decomp/mk64/actions/workflows/linux-compile.yml/badge.svg)](https://github.com/n64decomp/mk64/actions/workflows/linux-compile.yml)
## Progress
Total progress consists of all code segments together.
Game code progress consists of `main`, `ending` and `racing`.
[![Build Status](https://ci.valandil.ca/buildStatus/icon?job=mk64%2Fmaster&config=totalProgress)](https://ci.valandil.ca/job/mk64/job/master/)
[![Build Status](https://ci.valandil.ca/buildStatus/icon?job=mk64%2Fmaster&config=gameProgress)](https://ci.valandil.ca/job/mk64/job/master/)
![Build Status](https://n64decomp.github.io/mk64/total_progress.svg)
![Build Status](https://n64decomp.github.io/mk64/game_progress.svg)
[![Build Status](https://ci.valandil.ca/buildStatus/icon?job=mk64%2Fmaster&config=bytesLeft)](https://ci.valandil.ca/job/mk64/job/master/)
[![Build Status](https://ci.valandil.ca/buildStatus/icon?job=mk64%2Fmaster&config=m2c)](https://ci.valandil.ca/job/mk64/job/master/)
[![Build Status](https://ci.valandil.ca/buildStatus/icon?job=mk64%2Fmaster&config=nonmatching)](https://ci.valandil.ca/job/mk64/job/master/)
![Build Status](https://n64decomp.github.io/mk64/asm_funcs.svg)
![Build Status](https://n64decomp.github.io/mk64/m2c_funcs.svg)
![Build Status](https://n64decomp.github.io/mk64/nonmatching_funcs.svg)
- [![Build Status](https://ci.valandil.ca/buildStatus/icon?job=mk64%2Fmaster&config=mainProgress)](https://ci.valandil.ca/job/mk64/job/master/)
- [![Build Status](https://ci.valandil.ca/buildStatus/icon?job=mk64%2Fmaster&config=endingProgress)](https://ci.valandil.ca/job/mk64/job/master/)
- [![Build Status](https://ci.valandil.ca/buildStatus/icon?job=mk64%2Fmaster&config=racingProgress)](https://ci.valandil.ca/job/mk64/job/master/)
- [![Build Status](https://ci.valandil.ca/buildStatus/icon?job=mk64%2Fmaster&config=audioProgress)](https://ci.valandil.ca/job/mk64/job/master/)
- [![Build Status](https://ci.valandil.ca/buildStatus/icon?job=mk64%2Fmaster&config=osProgress)](https://ci.valandil.ca/job/mk64/job/master/)
- ![Build Status](https://n64decomp.github.io/mk64/seg_main_progress.svg)
- ![Build Status](https://n64decomp.github.io/mk64/seg_ending_progress.svg)
- ![Build Status](https://n64decomp.github.io/mk64/seg_racing_progress.svg)
- ![Build Status](https://n64decomp.github.io/mk64/audio_progress.svg)
- ![Build Status](https://n64decomp.github.io/mk64/libultra_progress.svg)
## Quick Start
@ -39,7 +41,6 @@ Extract assets
```
make assets -j
```
```
make -j
```

View File

@ -30,11 +30,11 @@ Review the [n64decomp/sm64](https://github.com/n64decomp/sm64) readme for instru
# Windows
- Clone the repo or download the zip.
- Download and extract the toolchain from [here](https://github.com/coco875/mk64-tools/releases/download/v0.0.6/mips-tools-chain-windows.zip)
- Download and extract the toolchain from [here](https://github.com/coco875/mk64-tools/releases/download/v0.0.7/mips-tools-chain-windows.zip)
### Setup
- Place the `mingw64` folder from the toolchain into the tools folder like so: `mk64/tools/mingw64`.
- Open a terminal (cmd or powershell) in the repo folder and run `"tools\mingw64\w64devkit.exe"` and after `make`
- Open a terminal (cmd or powershell) in the repo folder and run `"tools\mingw64\w64devkit.exe"` and after `make assets && make -j`
- Wait for the build to finish and Enjoy!
# macOS

View File

@ -5,10 +5,11 @@ import json
import csv
import os
import re
from pybadges import badge
# Script arguments.
parser = argparse.ArgumentParser(description="Computes current progress throughout the whole project.")
parser.add_argument("format", nargs="?", default="text", choices=["text", "verbose", "totalBadge", "gameBadge", "mainBadge", "endingBadge", "racingBadge", "audioBadge", "osBadge", "bytesToDecompile", "globalAsmFuncs", "m2cFuncs", "nonmatchingFuncs"])
parser.add_argument("format", nargs="?", default="text", choices=["text", "verbose", "totalBadge", "gameBadge", "mainBadge", "endingBadge", "racingBadge", "audioBadge", "osBadge", "bytesToDecompile", "globalAsmFuncs", "m2cFuncs", "nonmatchingFuncs", "badge"])
parser.add_argument("-d", "--debug", dest='debug', action='store_true',
help="Adds additional debug information, outputs files parsed and score for each file")
parser.add_argument("-n", "--nonmatching", dest='nonmatching', action='store_true',
@ -24,7 +25,7 @@ def GetNonMatchingFunctions(files):
functions = []
for file in files:
with open(file) as f:
with open(file, encoding="utf-8") as f:
functions += re.findall(NON_MATCHING_FUNC_PATTERN, f.read(), re.DOTALL)
functions += re.findall(NON_MATCHING_PRAGMA_PATTERN, f.read(), re.DOTALL)
@ -38,7 +39,7 @@ def CountMipsToCFunctions(files):
functions = []
for file in files:
with open(file) as f:
with open(file, encoding="utf-8") as f:
functions += re.findall(MIPS_TO_C_FUNC_PATTERN, f.read(), re.DOTALL)
return functions
@ -51,7 +52,7 @@ def CountGlobalAsmFunctions(files):
functions = []
for file in files:
with open(file) as f:
with open(file, encoding="utf-8") as f:
functions += re.findall(GLOBAL_ASM_FUNC_PATTERN, f.read(), re.DOTALL)
return functions
@ -65,7 +66,7 @@ def GetCFunctions(files):
functions = []
for file in files:
with open(file) as f:
with open(file, encoding="utf-8") as f:
source_code = f.read()
# Parse regex pattern
@ -523,5 +524,46 @@ elif args.format == 'verbose':
print(str(segRacing) + "/" + str(seg_racing_size) + " bytes " + adjective + " in segRacing " + str(segRacingPct) + "%")
print(str(audio) + "/" + str(audio_size) + " bytes " + adjective + " in audio " + str(audioPct) + "%")
print(str(libultra) + "/" + str(libultra_size) + " bytes " + adjective + " in libultra " + str(libultraPct) + "%\n")
elif args.format == 'badge':
adjective = "decompiled" if args.nonmatching else "matched"
badge_size_left = badge(left_text="Size left", right_text=str(remaining_size), right_color="blue")
with open("docs/html/size_left.svg", "w") as f:
f.write(badge_size_left)
badge_total_size = badge(left_text="Total size", right_text=str(total_code_size), right_color="blue")
with open("docs/html/total_size.svg", "w") as f:
f.write(badge_total_size)
badge_total_pct = badge(left_text="Total progress", right_text=str(round(totalPct, 2))+"%", right_color="green")
with open("docs/html/total_progress.svg", "w") as f:
f.write(badge_total_pct)
badge_game_pct = badge(left_text="Game progress", right_text=str(round(gamePct, 2))+"%", right_color="green")
with open("docs/html/game_progress.svg", "w") as f:
f.write(badge_game_pct)
badge_asm_funcs = badge(left_text="ASM functions", right_text=str(TotalGlobalAsmFunctions), right_color="blue")
with open("docs/html/asm_funcs.svg", "w") as f:
f.write(badge_asm_funcs)
badge_nonmatching_funcs = badge(left_text="NON_MATCHING functions", right_text=str(TotalNonMatchingFunctions), right_color="blue")
with open("docs/html/nonmatching_funcs.svg", "w") as f:
f.write(badge_nonmatching_funcs)
badge_m2c_funcs = badge(left_text="MIPS_TO_C functions", right_text=str(TotalMipsToCFunctions), right_color="blue")
with open("docs/html/m2c_funcs.svg", "w") as f:
f.write(badge_m2c_funcs)
badge_seg_main = badge(left_text="Main progress", right_text=str(round(segMainPct, 2))+"%", right_color="green")
with open("docs/html/seg_main_progress.svg", "w") as f:
f.write(badge_seg_main)
badge_seg_ending = badge(left_text="Ending progress", right_text=str(round(segEndingPct, 2))+"%", right_color="green")
with open("docs/html/seg_ending_progress.svg", "w") as f:
f.write(badge_seg_ending)
badge_seg_racing = badge(left_text="Racing progress", right_text=str(round(segRacingPct, 2))+"%", right_color="green")
with open("docs/html/seg_racing_progress.svg", "w") as f:
f.write(badge_seg_racing)
badge_audio = badge(left_text="Audio progress", right_text=str(round(audioPct, 2))+"%", right_color="green")
with open("docs/html/audio_progress.svg", "w") as f:
f.write(badge_audio)
badge_libultra = badge(left_text="Libultra progress", right_text=str(round(libultraPct, 2))+"%", right_color="green")
with open("docs/html/libultra_progress.svg", "w") as f:
f.write(badge_libultra)
else:
print("Unknown format argument: " + args.format)

2
tools/.gitignore vendored
View File

@ -5,6 +5,6 @@
/displaylist_packer
/tkmk00
/extract_data_for_mio
/torch/build-cmake/*
/torch/cmake-build-release/*
__pycache__
*.pyc

View File

@ -55,7 +55,7 @@ if __name__ == "__main__":
doxygen_formatted_content = process_map_file(map_file_path)
# Specify the output file path
output_file_path = "tools/doxygen_syms.md"
output_file_path = "docs/doxygen_syms.md"
# Write the result to the output file
with open(output_file_path, 'w') as output_file:

File diff suppressed because it is too large Load Diff

6
tools/windows_build.py Normal file
View File

@ -0,0 +1,6 @@
import subprocess
bp = subprocess.Popen("tools/mingw64/w64devkit.exe", stdin=subprocess.PIPE)
bp.stdin.write(b"make assets && make -j && exit\n")
bp.stdin.close()
exit(bp.wait())