diff --git a/.github/workflows/build-examples.yml b/.github/workflows/build-examples.yml new file mode 100644 index 0000000..ca674be --- /dev/null +++ b/.github/workflows/build-examples.yml @@ -0,0 +1,67 @@ +name: build-examples + +on: [push, pull_request] + +jobs: + build-examples: + runs-on: ubuntu-22.04 + steps: + # Checkout repository + - name: Checkout + uses: actions/checkout@v4 + + # Install build dependencies + - name: Install build dependencies + run: | + sudo apt-get update + sudo apt-get -y install build-essential clang bison flex libreadline-dev gawk \ + tcl-dev libffi-dev git graphviz xdot pkg-config python3 \ + libboost-system-dev libboost-python-dev libboost-filesystem-dev \ + zlib1g-dev cmake libboost-all-dev libeigen3-dev libftdi-dev \ + python3-dev python3-pip + + # Install icestorm + - name: Install icestorm + run: | + mkdir icestorm + pushd icestorm + git init + git remote add origin https://github.com/YosysHQ/icestorm.git + git fetch --depth 1 origin 1a40ae75d4eebee9cce73a2c4d634fd42ed0110f + git reset --hard FETCH_HEAD + make -j$(nproc) + sudo make install + popd + + # Install nextpnr + - name: Install nextpnr + run: | + git clone https://github.com/YosysHQ/nextpnr.git -b nextpnr-0.6 --depth 1 + pushd nextpnr + cmake -DARCH=ice40 -DCMAKE_INSTALL_PREFIX=/usr/local . + make -j$(nproc) + sudo make install + popd + + # Install yosys + - name: Install yosys + run: | + git clone https://github.com/YosysHQ/yosys.git -b yosys-0.36 --depth 1 + pushd yosys + make -j$(nproc) + sudo make install + popd + + # Install gbdk-2020 + - name: Install gbdk-2020 + run: | + wget https://github.com/gbdk-2020/gbdk-2020/releases/download/4.2.0/gbdk-linux64.tar.gz + sudo tar -axvf gbdk-linux64.tar.gz -C /opt + + # Build examples + - name: Build examples + run: | + pushd ./examples + make + popd + diff --git a/examples/Makefile b/examples/Makefile new file mode 100644 index 0000000..05cfe63 --- /dev/null +++ b/examples/Makefile @@ -0,0 +1,18 @@ +SUBDIRS = mbc_128k_rom midi_sound_gen + +.PHONY: build +build: + @ for d in $(SUBDIRS); do \ + cd $$d; \ + $(MAKE); \ + cd ..; \ + done + +.PHONY: clean +clean: + @ for d in $(SUBDIRS); do \ + cd $$d; \ + $(MAKE) $@; \ + cd ..; \ + done +