-
Notifications
You must be signed in to change notification settings - Fork 159
112 lines (89 loc) · 2.54 KB
/
linux.yaml
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
name: linux
on:
push:
branches:
- master
paths:
- '.github/workflows/linux.yaml'
- '.github/scripts/run-test.sh'
- '.github/scripts/test-vad.sh'
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-ncnn/csrc/*'
pull_request:
branches:
- master
paths:
- '.github/workflows/linux.yaml'
- '.github/scripts/run-test.sh'
- '.github/scripts/test-vad.sh'
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-ncnn/csrc/*'
- 'sherpa-ncnn/csrc/*'
workflow_dispatch:
concurrency:
group: linux-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
linux:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ matrix.os }}-linux
- name: Configure CMake
shell: bash
run: |
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
cmake --version
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Release -DSHERPA_NCNN_ENABLE_FFMPEG_EXAMPLES=OFF ..
- name: Build sherpa-ncnn for ubuntu
run: |
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
cd build
make -j2
ls -lh lib
ls -lh bin
ls -lh bin/sherpa-ncnn
file bin/sherpa-ncnn
ls -lh bin/sherpa-ncnn-vad
file bin/sherpa-ncnn-vad
ls -lh bin/sherpa-ncnn-microphone
file bin/sherpa-ncnn-microphone
ls -lh bin/decode-file-c-api
file bin/decode-file-c-api
- name: Upload binary sherpa-ncnn and sherpa-ncnn-microphone
uses: actions/upload-artifact@v2
with:
name: sherpa-ncnn-pre-built-binaries-os-${{ matrix.os }}
path: ./build/bin
- name: Test vad
run: |
export PATH=$PWD/build/bin:$PATH
export EXE=sherpa-ncnn-vad
.github/scripts/test-vad.sh
- name: Test sherpa-ncnn
run: |
export PATH=$PWD/build/bin:$PATH
export EXE=sherpa-ncnn
.github/scripts/run-test.sh
- name: Test C API
run: |
export PATH=$PWD/build/bin:$PATH
export EXE=decode-file-c-api
.github/scripts/run-test.sh