Fix buffer size 0 behavior in GetStringInput, more optimization #135
Workflow file for this run
This file contains 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: Win/Mac/Linux Test | |
on: | |
push: | |
branches-ignore: | |
- gh-pages | |
- master | |
env: | |
AUTOTESTER_LIBS_GROUP: ${{github.workspace}}/toolchain/clibs.8xg | |
AUTOTESTER_ROM: ${{github.workspace}}/secrets/84pce_515_53.rom | |
CEDEV: ${{github.workspace}}/CEdev | |
CEDEV_BIN: ${{github.workspace}}/CEdev/bin | |
CEDEV_EXAMPLES: ${{github.workspace}}/CEdev/examples | |
CEDEV_TEST: ${{github.workspace}}/toolchain/test | |
CEMU_PATH: ${{github.workspace}}/CEmu | |
FASMG_DOMAIN: https://flatassembler.net | |
FASMG_PATH: ${{github.workspace}}/fasmg | |
HOST_DOMAIN: https://jacobly.com | |
SECRETS_PATH: ${{github.workspace}}/secrets | |
TOOLCHAIN_PATH: ${{github.workspace}}/toolchain | |
jobs: | |
build-and-test: | |
environment: Autotester | |
strategy: | |
fail-fast: false | |
matrix: | |
runs-on: [ubuntu-20.04, macos-latest, windows-latest] | |
compressed: [YES, NO] | |
include: | |
- nul: /dev/null | |
- runs-on: macos-latest | |
fasmg: /source/macos/x64/fasmg | |
- runs-on: windows-latest | |
fasmg: /fasmg.exe | |
env: "env:" | |
exe: .exe | |
nul: nul | |
ldflags: LDFLAGS="-static-libgcc -static-libstdc++ -static" | |
- runs-on: ubuntu-20.04 | |
fasmg: /fasmg.x64 | |
runs-on: ${{matrix.runs-on}} | |
steps: | |
- name: Prepare Build Environment | |
run: cmake -E echo >> $${{matrix.env}}GITHUB_PATH ${{env.CEDEV_BIN}} | |
- name: Download ez80-clang | |
id: ez80-clang | |
uses: carlosperate/[email protected] | |
with: | |
file-url: ${{env.HOST_DOMAIN}}/artifact?repo=llvm-project&branch=z80&file=ez80-clang${{matrix.exe}}-${{matrix.runs-on}}Release | |
- name: Extract ez80-clang | |
uses: DuckSoft/[email protected] | |
with: | |
pathSource: ${{steps.ez80-clang.outputs.file-path}} | |
pathTarget: ${{env.CEDEV_BIN}} | |
- name: Download ez80-link | |
id: ez80-link | |
uses: carlosperate/[email protected] | |
with: | |
file-url: ${{env.HOST_DOMAIN}}/artifact?repo=llvm-project&branch=z80&file=ez80-link${{matrix.exe}}-${{matrix.runs-on}}Release | |
- name: Extract ez80-link | |
uses: DuckSoft/[email protected] | |
with: | |
pathSource: ${{steps.ez80-link.outputs.file-path}} | |
pathTarget: ${{env.CEDEV_BIN}} | |
- name: Download Fasmg Download Page | |
id: fasmg-download | |
uses: carlosperate/[email protected] | |
with: | |
file-url: ${{env.FASMG_DOMAIN}}/download.php | |
- name: Parse Fasmg Download Page | |
id: fasmg-url | |
uses: QwerMike/xpath-action@v1 | |
with: | |
filename: ${{steps.fasmg-download.outputs.file-path}} | |
expression: //a[starts-with(text(),"flat assembler g ")]/@href | |
- name: Extract Fasmg Url | |
run: cmake -E echo >> $${{matrix.env}}GITHUB_ENV ${{steps.fasmg-url.outputs.result}} | |
- name: Download Fasmg | |
id: fasmg | |
uses: carlosperate/[email protected] | |
with: | |
file-url: ${{env.FASMG_DOMAIN}}/${{env.href}} | |
- name: Extract Fasmg | |
uses: DuckSoft/[email protected] | |
with: | |
pathSource: ${{steps.fasmg.outputs.file-path}} | |
pathTarget: ${{env.FASMG_PATH}} | |
- name: Setup Fasmg | |
run: cmake -E copy fasmg${{matrix.fasmg}} ${{env.CEDEV_BIN}}/fasmg${{matrix.exe}} | |
- name: Checkout CEmu | |
uses: actions/checkout@v3 | |
with: | |
repository: ${{github.repository_owner}}/CEmu | |
ref: latest-stable | |
path: ${{env.CEMU_PATH}} | |
persist-credentials: false | |
- name: Build CEmu | |
run: make -j4 -C ${{env.CEMU_PATH}}/core | |
- name: Build Autotester CLI | |
run: make -j4 -C ${{env.CEMU_PATH}}/tests/autotester ${{matrix.ldflags}} | |
- name: Install Autotester CLI | |
run: cmake -E copy ${{env.CEMU_PATH}}/tests/autotester/autotester${{matrix.exe}} ${{env.CEDEV_BIN}}/cemu-autotester${{matrix.exe}} | |
- name: Make Binaries Executable | |
if: runner.os != 'Windows' | |
run: chmod +x ${{env.CEDEV_BIN}}/* | |
- name: Test Build Dependencies | |
run: | | |
ez80-clang --version | |
ez80-link --version | |
fasmg ${{matrix.nul}} ${{matrix.nul}} | |
- name: Checkout Toolchain | |
uses: actions/checkout@v3 | |
with: | |
path: ${{env.TOOLCHAIN_PATH}} | |
submodules: recursive | |
persist-credentials: false | |
- name: Build Toolchain | |
run: make -j4 -C ${{env.TOOLCHAIN_PATH}} V=1 | |
- name: Build Libraries | |
run: | | |
make -j4 -C ${{env.TOOLCHAIN_PATH}} libs V=1 | |
make -j4 -C ${{env.TOOLCHAIN_PATH}} libs-zip V=1 | |
- name: Install Toolchain | |
env: | |
PREFIX: ${{github.workspace}} | |
run: make -j4 -C ${{env.TOOLCHAIN_PATH}} install V=1 DESTDIR=${{github.workspace}}/ | |
- name: Make Binaries Executable | |
if: runner.os != 'Windows' | |
run: chmod +x ${{env.CEDEV_BIN}}/* | |
- name: Build Test Graphics | |
run: make -j4 -C ${{env.CEDEV_TEST}} COMPRESSED=${{matrix.compressed}} V=1 gfx | |
- name: Build Tests | |
run: make -j4 -C ${{env.CEDEV_TEST}} COMPRESSED=${{matrix.compressed}} V=1 | |
- name: Upload Test Build Artifacts | |
uses: actions/upload-artifact@v2 | |
if: "contains(github.event.head_commit.message, 'upload')" | |
with: | |
name: tests-${{runner.os}}-${{matrix.compressed}} | |
path: ${{env.CEDEV_TEST}} | |
- name: Build Example Graphics | |
run: make -j4 -C ${{env.CEDEV_EXAMPLES}} COMPRESSED=${{matrix.compressed}} V=1 gfx | |
- name: Build Examples | |
run: make -j4 -C ${{env.CEDEV_EXAMPLES}} COMPRESSED=${{matrix.compressed}} V=1 | |
- name: Upload Example Build Artifacts | |
uses: actions/upload-artifact@v2 | |
if: "contains(github.event.head_commit.message, 'upload')" | |
with: | |
name: examples-${{runner.os}}-${{matrix.compressed}} | |
path: ${{env.CEDEV_EXAMPLES}} | |
- name: Download Secrets | |
id: download-secrets | |
uses: carlosperate/[email protected] | |
with: | |
file-url: ${{env.HOST_DOMAIN}}/${{github.repository_owner}}/secrets | |
location: ${{env.SECRETS_PATH}} | |
- name: Decrypt Secrets | |
env: | |
KEY: ${{secrets.SYMMETRIC_KEY_256}} | |
run: openssl enc -d -aes-256-cbc -iv a581c6a54a2b51143fecad6794deb32a -K "$${{matrix.env}}KEY" -in ${{steps.download-secrets.outputs.file-path}} -out ${{env.SECRETS_PATH}}/secrets.7z | |
- name: Extract Secrets | |
uses: DuckSoft/[email protected] | |
with: | |
pathSource: ${{env.SECRETS_PATH}}/secrets.7z | |
pathTarget: ${{env.SECRETS_PATH}} | |
- name: Test Examples | |
if: runner.os != 'Windows' | |
run: | | |
find ${{env.CEDEV_EXAMPLES}} -name autotest.json -print0 | { | |
failed=0 | |
while read -d '' test; do | |
make -C $(dirname $test) test || cmake -E true $((failed += $?)) | |
done | |
cmake -E echo "$failed tests failed" | |
exit $failed | |
} | |
- name: Test Examples | |
if: runner.os == 'Windows' | |
run: | | |
$failed = 0 | |
foreach ($test in get-childitem "${{env.CEDEV_EXAMPLES}}" -recurse -include autotest.json) { | |
make -C (split-path -path $test) test | |
$failed += $lastexitcode | |
} | |
cmake -E echo "$failed tests failed" | |
exit $failed | |
- name: Test Tests | |
if: runner.os != 'Windows' | |
run: | | |
find ${{env.CEDEV_TEST}} -name autotest.json -print0 | { | |
failed=0 | |
while read -d '' test; do | |
make -C $(dirname $test) test || cmake -E true $((failed += $?)) | |
done | |
cmake -E echo "$failed tests failed" | |
exit $failed | |
} | |
- name: Test Tests | |
if: runner.os == 'Windows' | |
run: | | |
$failed = 0 | |
foreach ($test in get-childitem "${{env.CEDEV_TEST}}" -recurse -include autotest.json) { | |
make -C (split-path -path $test) test | |
$failed += $lastexitcode | |
} | |
cmake -E echo "$failed tests failed" | |
exit $failed | |
- name: Remove Secrets | |
if: always() | |
run: cmake -E rm -rf ${{env.SECRETS_PATH}} | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Documentation Dependencies | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get install -y doxygen | |
cmake -E echo >> $${{matrix.env}}GITHUB_PATH $${{matrix.env}}HOME/.local/bin | |
- name: Checkout Toolchain | |
uses: actions/checkout@v3 | |
with: | |
path: ${{env.TOOLCHAIN_PATH}} | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: Install Sphinx Dependencies | |
run: pip install -r ${{env.TOOLCHAIN_PATH}}/docs/requirements.txt | |
- name: Build Website Documentation | |
run: make -C ${{env.TOOLCHAIN_PATH}} docs | |
- name: Disable Jekyll | |
run: cmake -E touch ${{env.TOOLCHAIN_PATH}}/docs/build/html/.nojekyll | |
- name: Remove .pickle files | |
run: find ${{env.TOOLCHAIN_PATH}}/docs/build/ -name '*.pickle' -delete |