Change to Github actions for building + releasing & testing (#166)

Should fix the issue with temp-builds on appveyor as well.
This commit is contained in:
Lorenzooone 2022-07-03 22:52:08 +02:00 committed by GitHub
parent b75fb2b9da
commit c949c2a29c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 156 additions and 3 deletions

39
.github/workflows/build_master.yml vendored Normal file
View File

@ -0,0 +1,39 @@
name: Build
on:
# Trigger the workflow on push or pull request,
# but only for the master branch
push:
branches:
- develop
jobs:
build:
name: Patch building
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build the patch
run: "docker run --rm -u root -v ${PWD}:/home/m2gba/src lorenzooone/m2gba_translation:patch_builder"
- name: Archive resulting patch
uses: actions/upload-artifact@v3
with:
name: m12-patch
path: out/m12.ips
publish:
name: Patch publishing
runs-on: ubuntu-latest
needs: build
steps:
- name: Download a single artifact
uses: actions/download-artifact@v3
with:
name: m12-patch
- name: Auto-Release the patch
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "nightly-latest"
prerelease: true
title: "Automatic Build"
files: |
m12.ips

19
.github/workflows/build_pr.yml vendored Normal file
View File

@ -0,0 +1,19 @@
name: Build PR
on:
pull_request:
branches: develop
jobs:
build:
name: Patch building
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build the patch
run: "docker run --rm -u root -v ${PWD}:/home/m2gba/src lorenzooone/m2gba_translation:patch_builder"
- name: Archive resulting patch
uses: actions/upload-artifact@v3
with:
name: m12-patch
path: out/m12.ips

37
.github/workflows/test_master.yml vendored Normal file
View File

@ -0,0 +1,37 @@
name: Test
on:
# Trigger the workflow on push or pull request,
# but only for the master branch
push:
branches:
- develop
jobs:
test:
name: Testing
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Unpack the required data for the tests
run: |
gpg --quiet --batch --yes --decrypt --passphrase="$TESTING_PASSPHRASE" --output bin/testing_required_data.zip bin/testing_required_data.zip.gpg
sudo apt install unzip
unzip -q bin/testing_required_data.zip -d bin
env:
TESTING_PASSPHRASE: ${{ secrets.TESTING_PASSPHRASE }}
- name: Test the code
run: "docker run --rm -u root -v ${PWD}:/home/m2gba/src lorenzooone/m2gba_translation:tester"
- name: Archive test results
if: always()
uses: actions/upload-artifact@v3
with:
name: test-report
path: out/test.log
- name: Create Issue for Test failure
if: failure()
uses: peter-evans/create-issue-from-file@v4
with:
title: Test failure
content-filepath: out/test.log
labels: |
report
automated issue

26
.github/workflows/test_pr.yml vendored Normal file
View File

@ -0,0 +1,26 @@
name: Test PR
on:
pull_request:
branches: develop
jobs:
test:
name: Testing
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Unpack the required data for the tests
run: |
gpg --quiet --batch --yes --decrypt --passphrase="$TESTING_PASSPHRASE" --output bin/testing_required_data.zip bin/testing_required_data.zip.gpg
sudo apt install unzip
unzip -q bin/testing_required_data.zip -d bin
env:
TESTING_PASSPHRASE: ${{ secrets.TESTING_PASSPHRASE }}
- name: Test the code
run: "docker run --rm -u root -v ${PWD}:/home/m2gba/src lorenzooone/m2gba_translation:tester"
- name: Archive test results
if: always()
uses: actions/upload-artifact@v3
with:
name: test-report
path: out/test.log

1
.gitignore vendored
View File

@ -15,6 +15,7 @@ working/*.asm
working/*.bin
working/m12-labels.txt
armips.exe
testing_required_data.zip.gpg
*.sym
m2-compiled.asm

View File

@ -1,7 +1,7 @@
| Branch | Status |
| --- | --- |
| Project | [![Build status](https://ci.appveyor.com/api/projects/status/9ml81r7fn0k7i8g1?svg=true)](https://ci.appveyor.com/project/jeffman/mother2gbatranslation) |
| `master` | [![Build status](https://ci.appveyor.com/api/projects/status/9ml81r7fn0k7i8g1/branch/master?svg=true)](https://ci.appveyor.com/project/jeffman/mother2gbatranslation/branch/master) |
| `master` | [![Build](https://github.com/Lorenzooone/Mother2GbaTranslation/actions/workflows/build_master.yml/badge.svg)](https://github.com/Lorenzooone/Mother2GbaTranslation/actions/workflows/build_master.yml) |
| `master` | [![Test](https://github.com/Lorenzooone/Mother2GbaTranslation/actions/workflows/test_master.yml/badge.svg)](https://github.com/Lorenzooone/Mother2GbaTranslation/actions/workflows/test_master.yml) |
# MOTHER 2 Translation for the GBA
This is a work-in-progress translation patch for MOTHER 2 on the GBA.

Binary file not shown.

View File

@ -30,6 +30,10 @@ WORKDIR /opt/src
USER m2gba
CMD /home/m2gba/src/docker-scripts/docker-build-rom-script
#--------------------- Building patch ------------------------
FROM builder AS patch_builder
CMD /home/m2gba/src/docker-scripts/docker-build-patch-script
#---------------------- Building mgba ------------------------
FROM builder AS mgba_builder
USER root

View File

@ -0,0 +1,3 @@
#!/bin/bash
docker image rm lorenzooone/m2gba_translation:patch_builder
docker build --target patch_builder . -t lorenzooone/m2gba_translation:patch_builder

View File

@ -0,0 +1,18 @@
#!/bin/pwsh
$Env:PATH += ":/home/m2gba/.dotnet:/home/m2gba/.dotnet/tools"
Copy-Item -Path "\home\m2gba\src\*" -Destination "\opt\src" -Recurse -Force
"Starting to build tools"
./build-tools.ps1
if ($LASTEXITCODE -ne 0) { exit -1 }
"Starting to build rom"
./build-appveyor.ps1
if ($LASTEXITCODE -ne 0) { exit -1 }
"Copying patch to output"
New-Item -Path "\home\m2gba\src" -Name "out" -ItemType "directory" -Force
Copy-Item -Path ".\bin\m12.ips" "\home\m2gba\src\out"
"Build successful, please review the folder ./out/m12.ips for the resulting patch"

View File

@ -5,9 +5,11 @@ Copy-Item -Path "\home\m2gba\src\*" -Destination "\opt\src" -Recurse -Force
"Starting to build tools"
./build-tools.ps1
if ($LASTEXITCODE -ne 0) { exit -1 }
"Starting to build rom"
./build.ps1
if ($LASTEXITCODE -ne 0) { exit -1 }
"Copying rom to output"
New-Item -Path "\home\m2gba\src" -Name "out" -ItemType "directory" -Force

View File

@ -10,13 +10,17 @@ Copy-Item -Path "\home\m2gba\src\*" -Destination "\opt\src" -Recurse -Force
"Starting to build tools"
./build-tools.ps1
if ($LASTEXITCODE -ne 0) { exit -1 }
"Starting to build test rom"
./test.ps1
$LAST_VAL = $LASTEXITCODE
"Copying test log to output"
New-Item -Path "\home\m2gba\src" -Name "out" -ItemType "directory" -Force
Copy-Item -Path ".\bin\test.log" "\home\m2gba\src\out"
Copy-Item -Path ".\bin\m12test.gba" "\home\m2gba\src\out"
if ($LAST_VAL -ne 0) { exit -1 }
"Test ran successfully, please review the ./out folder for the resulting logs and test rom"

View File

@ -231,4 +231,4 @@ int custom_codes_parse_generic(int code, char* parserAddress, WINDOW* window, by
}
return addedSize;
}
}