Skip to content

Commit

Permalink
add workflow for build verification of examples
Browse files Browse the repository at this point in the history
  • Loading branch information
rniwase committed Jan 3, 2024
1 parent 225d01d commit ab2e88d
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/build-examples.yml
Original file line number Diff line number Diff line change
@@ -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
18 changes: 18 additions & 0 deletions examples/Makefile
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit ab2e88d

Please sign in to comment.