mirror of
https://github.com/MonsterDruide1/OdysseyDecomp
synced 2026-04-23 09:04:21 +00:00
75 lines
2.5 KiB
YAML
75 lines
2.5 KiB
YAML
name: Compile and verify functions
|
|
on:
|
|
push:
|
|
pull_request_target:
|
|
types: [opened, synchronize]
|
|
permissions:
|
|
contents: read
|
|
pull-requests: read
|
|
|
|
jobs:
|
|
compile_verify:
|
|
if: github.repository == 'MonsterDruide1/OdysseyDecomp'
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Check out project
|
|
uses: actions/checkout@v6
|
|
with:
|
|
submodules: recursive
|
|
- name: Check out branch if in PR
|
|
if: ${{ github.event_name == 'pull_request_target' }}
|
|
uses: actions/checkout@v6
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
submodules: recursive
|
|
- name: Check for W-state functions
|
|
run: |
|
|
if grep -q "status: Wip" "data/odyssey_functions.csv"; then
|
|
echo "Function list should not contain WIP-functions!"
|
|
echo "Found the following lines:"
|
|
grep "status: Wip" "data/odyssey_functions.csv"
|
|
exit 1
|
|
fi
|
|
- name: Set up dependencies
|
|
run: |
|
|
sudo apt update && sudo apt install -y python3-pip ninja-build cmake ccache xdelta3 clang libssl-dev python-is-python3 curl
|
|
wget http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2_amd64.deb && sudo dpkg -i libtinfo5_6.3-2_amd64.deb && rm -f libtinfo5_6.3-2_amd64.deb
|
|
- name: Set up python
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: '3.14'
|
|
cache: 'pip'
|
|
- name: Set up python package dependencies
|
|
run: pip install capstone colorama cxxfilt pyelftools watchdog python-Levenshtein toml
|
|
- name: Download main.nso from secret
|
|
env:
|
|
EXEFS_SHARED_PASS: ${{ secrets.EXEFS_SHARED_PASS }}
|
|
run: curl -u "github-odyssey:$EXEFS_SHARED_PASS" https://monsterdruide.one/secrets/smo-main.nso -O
|
|
- name: Set up cache for toolchain
|
|
uses: actions/cache@v5
|
|
with:
|
|
key: tools_libs
|
|
path: |
|
|
toolchain/bin
|
|
toolchain/libcxx-include
|
|
toolchain/cache-version-url.txt
|
|
- name: Run setup
|
|
run: tools/setup.py smo-main.nso
|
|
- name: Build project
|
|
run: tools/build.py
|
|
- name: Verify function states
|
|
run: |
|
|
var="$(tools/check 2> errfile || true)"
|
|
if [[ "$(cat errfile)" == "OK" ]]; then
|
|
exit 0
|
|
else
|
|
cat errfile | tr '\n' '\f' | sed 's/Stack backtrace:.*//' | tr '\f' '\n'
|
|
exit 1
|
|
fi
|
|
- name: Upload build artifact
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: odyssey
|
|
path: build/odyssey
|
|
if-no-files-found: error
|