-
Notifications
You must be signed in to change notification settings - Fork 55
193 lines (179 loc) · 6.38 KB
/
package.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
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) }}}'