on-llvm-update #861
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: Package | |
concurrency: sdk-package | |
env: | |
TEST_TOOLS_DIR: ${{ github.workspace }}/tt | |
MESEN_DIR: ${{ github.workspace }}/tt/mesen | |
EMUTEST_DIR: ${{ github.workspace }}/tt/emutest | |
LIBRETRO_CORES_DIR: ${{ github.workspace }}/tt/libretro | |
on: | |
push: | |
branches: [ main ] | |
paths-ignore: | |
- 'README.md' | |
workflow_dispatch: | |
repository_dispatch: | |
jobs: | |
build-test-tools: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Cache test tools | |
id: cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.TEST_TOOLS_DIR }} | |
key: ${{ runner.os }}-test-tools-${{ github.workflow_sha }} | |
- name: Set up Go | |
if: steps.cache.outputs.cache-hit != 'true' | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21' | |
- name: Build Emutest binary | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: | | |
git clone https://github.com/sehugg/emutest | |
cd emutest | |
go install | |
mkdir -p ${{ env.EMUTEST_DIR }} | |
GOPATH=$(go env GOPATH) | |
cp $GOPATH/bin/emutest ${{ env.EMUTEST_DIR }} | |
- name: Build Stella2014 core | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: | | |
git clone https://github.com/libretro/stella2014-libretro | |
cd stella2014-libretro | |
make --silent -j 4 | |
mkdir -p ${{ env.LIBRETRO_CORES_DIR }} | |
mv stella2014_libretro.so ${{ env.LIBRETRO_CORES_DIR }} | |
- name: Build Mesen-X core | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: | | |
git clone https://github.com/NovaSquirrel/Mesen-X | |
cd Mesen-X/Libretro | |
make --silent -j 4 | |
mkdir -p ${{ env.LIBRETRO_CORES_DIR }} | |
mv mesen_libretro.so ${{ env.LIBRETRO_CORES_DIR }} | |
- name: Upload test tools | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-tools | |
path: ${{env.TEST_TOOLS_DIR }} | |
package: | |
runs-on: ${{ matrix.os }} | |
needs: build-test-tools | |
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 git | |
- 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: Restore test tools | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.TEST_TOOLS_DIR }} | |
key: ${{ runner.os }}-test-tools-${{ github.workflow_sha }} | |
restore-keys: | | |
${{ runner.os }}-test-tools- | |
- 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 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -G "Ninja" .. | |
ninja install | |
- name: Test the SDK. | |
if: startsWith(matrix.os, 'ubuntu') | |
run: | | |
cd build | |
CTEST_OUTPUT_ON_FAILURE=1 ninja test | |
- name: Upload test screenshots. | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-screenshots-${{ runner.os }} | |
path: build/**/*.png | |
- 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@v4 | |
with: | |
name: sdk-${{ runner.os }} | |
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@v4 | |
with: | |
pattern: sdk-* | |
merge-multiple: true | |
- 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) }}}' |