forked from primesearch/mfakto
-
Notifications
You must be signed in to change notification settings - Fork 0
123 lines (118 loc) · 3.71 KB
/
ci.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
name: mfakto CI
on:
push:
pull_request:
jobs:
Linux:
name: Linux
runs-on: ubuntu-24.04
env:
CC: gcc
CPP: g++
steps:
- uses: actions/checkout@v4
- name: Setup
run: |
sudo apt-get install -y ocl-icd-opencl-dev pocl-opencl-icd
- name: Build
run: |
make -C src -O -j "$(nproc)" CC=${CC} CPP=${CPP}
- name: Test
run: |
./mfakto -d 11
- name: Create artifact and release asset
run: |
tar cvjf mfakto-${{ github.ref_name }}-linux64.tar.bz2 *.cl Changelog-mfakto.txt COPYING datatypes.h mfakto mfakto.ini README-SpecialVersions.txt README.txt tf_debug.h todo.txt
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: mfakto-linux64
path: |
*.cl
Changelog-mfakto.txt
COPYING
datatypes.h
mfakto
mfakto.ini
README-SpecialVersions.txt
README.txt
tf_debug.h
todo.txt
- name: Upload release assets on release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
mfakto-${{ github.ref_name }}-linux64.tar.bz2
WindowsMSVC:
name: Windows MSVC
runs-on: windows-2022
env:
OCL_ROOT: "OpenCL-SDK-v2024.05.08-Win-x64"
OCL_URL: https://github.com/KhronosGroup/OpenCL-SDK/releases/download/v2024.05.08/OpenCL-SDK-v2024.05.08-Win-x64.zip
steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
- name: Setup
run: |
Invoke-WebRequest $env:OCL_URL -OutFile OpenCL-SDK.zip
unzip OpenCL-SDK.zip
mkdir $env:OCL_ROOT\lib\x86_64
cp $env:OCL_ROOT\lib\*.lib $env:OCL_ROOT\lib\x86_64
- name: Build
run: |
msbuild mfaktoVS12.vcxproj /property:OCL_ROOT="$env:OCL_ROOT"
- name: Create artifact and release asset
run: |
Copy-Item -Path Changelog-mfakto.txt, COPYING, README-SpecialVersions.txt, README.txt, todo.txt -Destination x64/Debug/
Compress-Archive -DestinationPath mfakto-${{ github.ref_name }}-windows-msvc.zip -CompressionLevel Optimal -Path x64/Debug/*
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: mfakto-windows-msvc
path: x64/Debug/
- name: Upload release asset on release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
mfakto-${{ github.ref_name }}-windows-msvc.zip
WindowsMSYS2:
name: Windows MSYS2
runs-on: windows-2022
env:
CC: gcc
CPP: g++
steps:
- uses: actions/checkout@v4
- name: Path Setup
run: |
echo "C:\msys64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "C:\msys64\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Setup
run: |
pacman -S --needed --noconfirm mingw-w64-x86_64-opencl-icd mingw-w64-x86_64-opencl-headers
- name: Build
run: |
make -C src -O -j $env:NUMBER_OF_PROCESSORS CC=$env:CC CPP=$env:CPP AMD_APP_INCLUDE="-IC:\msys64\mingw64\include" AMD_APP_LIB="-LC:\msys64\mingw64\lib"
MacOS:
name: MacOS
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-13, macos-14]
fail-fast: false
env:
CC: clang
CPP: clang++
steps:
- uses: actions/checkout@v4
- name: Setup
run: |
brew install pocl
- name: Build
run: |
make -C src -f Makefile.macOS -j "$(sysctl -n hw.ncpu)" CC=${CC} CPP=${CPP} CFLAGS="-O3 -Wall $(pkg-config --cflags pocl)" LDFLAGS="$(pkg-config --libs pocl)"
- name: Test
run: |
./mfakto -d 11