Skip to content
This repository was archived by the owner on Apr 8, 2024. It is now read-only.

Commit 5ce4318

Browse files
authored
Merge pull request #60 from spacemeshos/add-m1-ci
Add M1 CI
2 parents 08ce268 + b6a93ba commit 5ce4318

File tree

1 file changed

+83
-5
lines changed

1 file changed

+83
-5
lines changed

.github/workflows/build.yml

+83-5
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ name: Build
22

33
on:
44
push:
5-
# release:
6-
# types:
7-
# - created
85

96
jobs:
107
linux:
@@ -232,9 +229,87 @@ jobs:
232229
name: macos
233230
path: ${{ env.VULKAN_ROOT_LOCATION }}/macOS/lib/libvulkan.1.dylib
234231

232+
macos-m1:
233+
runs-on: self-hosted
234+
235+
steps:
236+
- uses: actions/checkout@v2
237+
with:
238+
submodules: true
239+
240+
- name: Setup env
241+
run: echo "VULKAN_ROOT_LOCATION=$VULKAN_ROOT_LOCATION" >> $GITHUB_ENV
242+
243+
- run: arch -arm64 cmake -DSPACEMESHCUDA=OFF .
244+
245+
- run: arch -arm64 make
246+
247+
- name: Copy library
248+
run: cp src/libgpu-setup.dylib test/libgpu-setup.dylib
249+
250+
- name: Fix library import paths
251+
run: arch -arm64 install_name_tool -add_rpath @loader_path test/libgpu-setup.dylib
252+
253+
- name: Unit tests - Golden vectors
254+
run: arch -arm64 test/gpu-setup-test --test-vector-check
255+
256+
- name: Unit tests - hash and bitstream
257+
run: arch -arm64 test/gpu-setup-test --unit-tests
258+
259+
- name: Unit tests - PoW
260+
run: arch -arm64 test/gpu-setup-test -tp -d 18 -id 0xe26b543725490682675f6f84ea7689601adeaf14caa7024ec1140c82754ca339 --salt 0x165310acce39719148915c356f25c5cb78e82203222cccdf3c15a9c3684e08cb -si 126202
261+
262+
- name: Unit tests - label lengths
263+
run: arch -arm64 test/gpu-setup-test -il
264+
265+
- name: Unit tests - labels count
266+
run: arch -arm64 test/gpu-setup-test -in
267+
268+
- name: Integration tests - concurrency test
269+
run: arch -arm64 test/gpu-setup-test -ip
270+
271+
- name: Integration tests - cancelation test
272+
run: arch -arm64 test/gpu-setup-test -ic
273+
274+
- name: Upload library
275+
uses: actions/upload-artifact@v2
276+
with:
277+
name: macos-m1
278+
path: src/libgpu-setup.dylib
279+
280+
- name: Upload test app
281+
uses: actions/upload-artifact@v2
282+
with:
283+
name: macos-m1
284+
path: test/gpu-setup-test
285+
286+
- name: Upload api.h
287+
uses: actions/upload-artifact@v2
288+
with:
289+
name: macos-m1
290+
path: include/api.h
291+
292+
- name: Upload MoltenVK
293+
uses: actions/upload-artifact@v2
294+
with:
295+
name: macos-m1
296+
path: ${{ env.VULKAN_ROOT_LOCATION }}/MoltenVK/dylib/macOS/libMoltenVK.dylib
297+
298+
- name: Upload MoltenVK config
299+
uses: actions/upload-artifact@v2
300+
with:
301+
name: macos-m1
302+
path: ${{ env.VULKAN_ROOT_LOCATION }}/MoltenVK/dylib/macOS/MoltenVK_icd.json
303+
304+
- name: Upload Vulkan
305+
uses: actions/upload-artifact@v2
306+
with:
307+
name: macos-m1
308+
path: ${{ env.VULKAN_ROOT_LOCATION }}/macOS/lib/libvulkan.1.dylib
309+
235310
release:
236311
runs-on: ubuntu-latest
237-
needs: [linux, windows, macos]
312+
needs: [linux, windows, macos, macos-m1]
238313
env:
239314
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
240315
if: startsWith(github.ref, 'refs/tags/v')
@@ -282,6 +357,9 @@ jobs:
282357
# asset_name: libgpu-setup-macos-${{ env.VERSION }}.zip
283358
# asset_content_type: application/zip
284359

360+
- name: Archive MacOS-M1 Library
361+
run: zip --junk-paths libgpu-setup-macos-m1-${{ env.VERSION }}.zip macos-m1/*
362+
285363
- name: Release
286364
uses: softprops/action-gh-release@v1
287365
with:
@@ -290,6 +368,6 @@ jobs:
290368
libgpu-setup-linux-${{ env.VERSION }}.zip
291369
libgpu-setup-windows-${{ env.VERSION }}.zip
292370
libgpu-setup-macos-${{ env.VERSION }}.zip
371+
libgpu-setup-macos-m1-${{ env.VERSION }}.zip
293372
env:
294373
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
295-

0 commit comments

Comments
 (0)