-
Notifications
You must be signed in to change notification settings - Fork 140
85 lines (72 loc) · 1.87 KB
/
build.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
name: build
on:
push:
paths:
- 'models/**'
- CMakeLists.txt
branches:
- main
tags-ignore:
- '**'
workflow_dispatch:
jobs:
build:
name: ${{ matrix.os }} ${{ matrix.cublas == 'ON' && 'cuda' || matrix.instructions }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04
- macos-latest
- windows-latest
instructions:
- avx2
- avx
- basic
cublas:
- OFF
include:
- os: ubuntu-20.04
instructions: avx2
cublas: ON
- os: windows-latest
instructions: avx2
cublas: ON
steps:
- uses: actions/checkout@v3
- if: ${{ matrix.cublas == 'ON' && startsWith(runner.os, 'Linux') }}
uses: jlumbroso/[email protected]
- if: ${{ matrix.cublas == 'ON' }}
uses: Jimver/[email protected]
id: cuda-toolkit
with:
cuda: '12.1.0'
- name: Build
run: |
cmake -B build -DCT_INSTRUCTIONS=${{ matrix.instructions }} -DCT_CUBLAS=${{ matrix.cublas }}
cmake --build build --config Release
mkdir tmp
mv build/lib tmp/${{ matrix.cublas == 'ON' && 'cuda' || matrix.instructions }}
- uses: actions/upload-artifact@v3
with:
name: libraries
path: tmp
if-no-files-found: error
finish:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ssh-key: ${{ secrets.DEPLOY_KEY }}
- uses: actions/download-artifact@v3
with:
name: libraries
path: ctransformers/lib
- uses: git-actions/set-user@v1
- name: Save
run: |
git add ctransformers/lib
git commit -m 'Auto Build'
git push