Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
168 changes: 168 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
name: Build

on:
push:
pull_request:

permissions:
contents: read
packages: read
pull-requests: write

jobs:
build_repo:
name: Build repo
runs-on: ubuntu-latest
container:
image: ghcr.io/pmret/papermario-build:main
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Provide build images
run: |
for version in us jp ique pal; do
ln -s "/orig/${version}/baserom.z64" "ver/${version}/baserom.z64"
done

- name: Obtain compilers
run: |
wget -qO- "https://github.com/pmret/gcc-papermario/releases/download/master/linux.tar.gz" | tar zx -C tools/build/cc/gcc
wget -qO- "https://github.com/pmret/binutils-papermario/releases/download/master/linux.tar.gz" | tar zx -C tools/build/cc/gcc
wget -qO- "https://github.com/decompals/ido-static-recomp/releases/download/v0.2/ido-5.3-recomp-ubuntu-latest.tar.gz" | tar zx -C tools/build/cc/ido5.3
wget -qO- "https://github.com/decompals/mips-gcc-2.7.2/releases/download/main/gcc-2.7.2-linux.tar.gz" | tar zx -C tools/build/cc/gcc2.7.2
wget -qO- "https://github.com/decompals/mips-binutils-2.6/releases/download/main/binutils-2.6-linux.tar.gz" | tar zx -C tools/build/cc/gcc2.7.2
wget -qO- "https://github.com/decompals/mips-binutils-egcs-2.9.5/releases/latest/download/mips-binutils-egcs-2.9.5-linux.tar.gz" | tar zx -C tools/build/cc/egcs
wget -qO- "https://github.com/decompals/mips-gcc-egcs-2.91.66/releases/latest/download/mips-gcc-egcs-2.91.66-linux.tar.gz" | tar zx -C tools/build/cc/egcs

- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Install dependencies
run: |
python3 -m pip install -U -r tools/configure/requirements.txt --break-system-packages
python3 -m pip install -U -r tools/configure/requirements_extra.txt --break-system-packages
cargo install pigment64
cargo install crunch64-cli

- name: Setup
run: ./configure

- name: Build
run: bash -o pipefail -c 'ninja 2>&1 | tee build_log.txt'

- name: Generate pull request report
if: >-
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository
run: |
: > pr-comment.md
for version in us jp ique pal; do
python3 progress.py "$version" --pr-comment >> pr-comment.md
done
./tools/warnings_count/compare_warnings.py --pr-message >> pr-comment.md

- name: Update pull request report
if: >-
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository
uses: actions/github-script@v9
with:
script: |
const fs = require('fs');
const marker = '<!-- papermario-build-report -->';
const report = fs.readFileSync('pr-comment.md', 'utf8').trim();

if (!report) {
return;
}

const body = `${marker}\n${report}`;
const comments = await github.paginate(
github.rest.issues.listComments,
{
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
per_page: 100,
},
);
const existing = comments.find((comment) =>
comment.user.type === 'Bot' && comment.body.includes(marker),
);

if (existing) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: existing.id,
body,
});
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body,
});
}

- name: Generate progress reports
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
mkdir reports

for version in us jp ique pal; do
python3 progress.py "$version" --csv > "reports/progress_${version}.csv"
python3 progress.py "$version" --shield-json > "reports/progress_${version}_shield.json"
done

grep warning build_log.txt | sort > reports/warnings.txt || true

- name: Stage progress reports on papermar.io
if: >-
github.event_name == 'push' &&
github.ref == 'refs/heads/main' &&
github.repository == 'pmret/papermario'
uses: appleboy/scp-action@v1
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
source: reports/*
target: /tmp/papermario-ci-${{ github.run_id }}
strip_components: 1

- name: Publish progress reports
if: >-
github.event_name == 'push' &&
github.ref == 'refs/heads/main' &&
github.repository == 'pmret/papermario'
uses: appleboy/ssh-action@v1
env:
REPORTS_DIR: /tmp/papermario-ci-${{ github.run_id }}
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
envs: REPORTS_DIR
script: |
set -eu
target=/var/www/papermar.io/html/reports

for version in us jp ique pal; do
cat "$REPORTS_DIR/progress_${version}.csv" >> "$target/progress_${version}.csv"
cp "$REPORTS_DIR/progress_${version}_shield.json" "$target/progress_${version}_shield.json"
done

cp "$REPORTS_DIR/warnings.txt" "$target/warnings.txt"
rm -r -- "$REPORTS_DIR"

- name: Build shifted US ROM
run: |
./configure --shift us
ninja
128 changes: 0 additions & 128 deletions Jenkinsfile

This file was deleted.

22 changes: 13 additions & 9 deletions decomp.yaml
Original file line number Diff line number Diff line change
@@ -1,41 +1,45 @@
name: Paper Mario
github: https://github.com/pmret/papermario
repo: https://github.com/pmret/papermario
platform: n64
versions:
- name: us
fullname: US
paths:
baserom: "ver/us/baserom.z64"
build: "ver/us/build/papermario.z64"
target: "ver/us/baserom.z64"
compiled_target: "ver/us/build/papermario.z64"
asm: "ver/us/asm"
nonmatchings: "ver/us/asm/nonmatchings"
map: "ver/us/build/papermario.map"
elf: "ver/us/build/papermario.elf"
build_dir: "ver/us/build"
- name: pal
fullname: PAL
paths:
baserom: "ver/pal/baserom.z64"
build: "ver/pal/build/papermario.z64"
target: "ver/pal/baserom.z64"
compiled_target: "ver/pal/build/papermario.z64"
asm: "ver/pal/asm"
nonmatchings: "ver/pal/asm/nonmatchings"
map: "ver/pal/build/papermario.map"
elf: "ver/pal/build/papermario.elf"
build_dir: "ver/pal/build"
- name: ique
fullname: iQue
paths:
baserom: "ver/ique/baserom.z64"
build: "ver/ique/build/papermario.z64"
target: "ver/ique/baserom.z64"
compiled_target: "ver/ique/build/papermario.z64"
asm: "ver/ique/asm"
nonmatchings: "ver/ique/asm/nonmatchings"
map: "ver/ique/build/papermario.map"
elf: "ver/ique/build/papermario.elf"
build_dir: "ver/ique/build"
- name: jp
fullname: JP
paths:
baserom: "ver/jp/baserom.z64"
build: "ver/jp/build/papermario.z64"
target: "ver/jp/baserom.z64"
compiled_target: "ver/jp/build/papermario.z64"
asm: "ver/jp/asm"
nonmatchings: "ver/jp/asm/nonmatchings"
map: "ver/jp/build/papermario.map"
elf: "ver/jp/build/papermario.elf"
build_dir: "ver/jp/build"
tools:
Loading