Skip to content

Port to Ben Eater's 6502 Breadboard Computer (#149) #453

Port to Ben Eater's 6502 Breadboard Computer (#149)

Port to Ben Eater's 6502 Breadboard Computer (#149) #453

Workflow file for this run

name: Package
concurrency: sdk-package
on:
push:
branches: [ main ]
paths-ignore:
- 'README.md'
workflow_dispatch:
repository_dispatch:
jobs:
package:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2019, macos-latest, ubuntu-20.04]
steps:
- name: Install Ubuntu build dependencies.
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get -y install doxygen graphviz ninja-build mono-complete libsdl2-2.0 gnome-themes-standard libgtk2.0-0 xvfb
MESEN_DIR=$(mktemp -d)
echo "MESEN_DIR=$MESEN_DIR" >> $GITHUB_ENV
cd $MESEN_DIR
curl -Lo mesen.zip https://github.com/NovaSquirrel/Mesen-X/releases/download/1.0.1/Mesen-Linux.2022-05-14.zip
unzip mesen.zip
chmod +x Mesen.exe
echo '#!/bin/sh' > mesen
echo "xvfb-run -a /usr/bin/mono $(pwd)/Mesen.exe \"\$@\"" >> mesen
chmod +x mesen
- name: Install Windows build dependencies.
if: startsWith(matrix.os, 'windows')
run: choco install curl ninja
- name: Install MacOS tools
if: startsWith(matrix.os, 'macos')
run: brew update && brew install ninja
- name: Check out the SDK.
uses: actions/checkout@v2
- name: Copy Mesen settings file.
if: startsWith(matrix.os, 'ubuntu')
run: cp test/mesen_settings.xml ${{ env.MESEN_DIR }}/settings.xml
- name: Fetch the latest Ubuntu llvm-mos release.
if: startsWith(matrix.os, 'ubuntu')
run: |
curl -LO https://github.com/llvm-mos/llvm-mos/releases/download/llvm-mos-linux-main/llvm-mos-linux-main.tar.xz
tar -xvf llvm-mos-linux-main.tar.xz
- name: Fetch the latest Windows llvm-mos release.
if: startsWith(matrix.os, 'windows')
run: |
curl -LO https://github.com/llvm-mos/llvm-mos/releases/download/llvm-mos-windows-main/llvm-mos-windows-main.7z
7z x llvm-mos-windows-main.7z
- name: Fetch the latest Mac llvm-mos release.
if: startsWith(matrix.os, 'macos')
run: |
curl -LO https://github.com/llvm-mos/llvm-mos/releases/download/llvm-mos-darwin-main/llvm-mos-darwin-main.tar.xz
tar -xvf llvm-mos-darwin-main.tar.xz
- name: Build the SDK.
run: |
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/llvm-mos -DMESEN_COMMAND=${{ env.MESEN_DIR }}/mesen -G "Ninja" ..
ninja install
- name: Test the SDK.
if: startsWith(matrix.os, 'ubuntu')
run: |
cd build
CTEST_OUTPUT_ON_FAILURE=1 ninja test
- name: Build the docs.
if: startsWith(matrix.os, 'ubuntu')
run: |
cd build
ninja doxygen
- name: Upload the docs to github pages.
if: startsWith(matrix.os, 'ubuntu')
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build/mos-platform/html
- name: Archive the Linux SDK.
if: startsWith(matrix.os, 'ubuntu')
run: tar -cJvf llvm-mos-linux.tar.xz llvm-mos
- name: Archive the Windows SDK.
if: startsWith(matrix.os, 'windows')
run: 7z a llvm-mos-windows.7z llvm-mos
- name: Archive the Mac OS SDK.
if: startsWith(matrix.os, 'macos')
run: tar -cJvf llvm-mos-macos.tar.xz llvm-mos
- name: Upload the SDK.
uses: actions/upload-artifact@v2
with:
path: |
llvm-mos-linux.tar.xz
llvm-mos-windows.7z
llvm-mos-macos.tar.xz
prerelease:
runs-on: ubuntu-latest
needs: package
steps:
- name: Download the SDK.
uses: actions/download-artifact@v2
with:
name: artifact
- name: Prerelease the SDK.
uses: softprops/action-gh-release@v1
with:
name: Prerelease SDK
body: Prerelease llvm-mos SDK.
tag_name: prerelease
files: |
llvm-mos-linux.tar.xz
llvm-mos-windows.7z
llvm-mos-macos.tar.xz
prerelease: true
- name: Dispatch Test Suite
uses: llvm-mos/repository-dispatch@v1
with:
token: ${{ secrets.ACTION_TOKEN }}
repository: llvm-mos/llvm-test-suite
event-type: on-sdk-update
client-payload: '{"head_commit": ${{ toJSON(github.event.head_commit) }}}'
- name: Dispatch Smoke Test
uses: llvm-mos/repository-dispatch@v1
with:
token: ${{ secrets.ACTION_TOKEN }}
repository: llvm-mos/smoke-test
event-type: on-sdk-update
client-payload: '{"head_commit": ${{ toJSON(github.event.head_commit) }}}'