Skip to content

Preliminary refactor of Makefiles for cross-compatibility with brickO… #88

Preliminary refactor of Makefiles for cross-compatibility with brickO…

Preliminary refactor of Makefiles for cross-compatibility with brickO… #88

Workflow file for this run

name: brickEmu CI
on:
workflow_dispatch:
inputs:
runValgrind:
description: 'Controls whether to run Valgrind job steps'
type: boolean
required: false
default: true
# NOTE: This input default does not apply for other "on" types (always null for push, pull_request, etc.)
schedule:
# Following POSIX cron syntax, run every Monday morning at 5:30 AM UTC
# https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07
- cron: '30 5 * * 1'
push:
# branches: [ master ]
pull_request:
# branches: [ master ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
python-version: [ 3.13 ]
steps:
- name: Checkout BrickEmu
uses: actions/checkout@v4
with:
path: src
- name: apt-get update
run: sudo apt-get --assume-yes update
- name: Install build dependencies
run: sudo apt-get --assume-yes install binutils-h8300-hms zlib1g-dev libsdl-sound1.2-dev libasound2-dev libsdl-sound1.2
- name: make_brick_emu
run: |
cd src
gcc --version
make
- name: Run Valgrind Memory Checker on emu
if: ${{ inputs.runValgrind }}
uses: Ximaz/[email protected]
with:
binary_path: src/emu
- name: Run Valgrind Memory Checker on brickEmu ir-server
if: ${{ inputs.runValgrind }}
uses: Ximaz/[email protected]
with:
binary_path: src/ir-server
- name: Checkout brickOS-bibo
uses: actions/checkout@v4
with:
repository: BrickBot/brickOS-bibo
path: brickos_bibo
- name: Install additional build dependencies needed by brickOS-bibo
run: sudo apt-get --assume-yes install gcc-h8300-hms
- name: Make brickOS-bibo
run: |
cd brickos_bibo
make
- name: Run Valgrind Memory Checker on firmdl
if: ${{ inputs.runValgrind }}
uses: Ximaz/[email protected]
with:
binary_path: brickos_bibo/util/firmdl
- name: Run Valgrind Memory Checker on dll
if: ${{ inputs.runValgrind }}
uses: Ximaz/[email protected]
with:
binary_path: brickos_bibo/util/dll
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
check-latest: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
cd src
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
cd src
python -m pytest ./tests
- name: Archive the files needed to execute
uses: actions/upload-artifact@v4
with:
name: brickEmu_[runner~${{ matrix.os }}]_run${{ github.run_id }}.${{ github.run_number }}.${{ github.run_attempt }}
path: |
src/GUI.tcl
src/emu
src/emu_server.py
src/ir-server
src/remote
src/rom.bin
src/rom.coff