-
-
Notifications
You must be signed in to change notification settings - Fork 98
71 lines (58 loc) · 2.23 KB
/
linux-native-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
name: Linux Native build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-20.04
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
submodules: true
ref: ${{ github.head_ref }}
- name: Check for submodule update
id: check_submodule
run: |
cd whisper.cpp
SUBMODULE_COMMIT_ID=$(git rev-parse HEAD)
echo "Submodule commit ID: $SUBMODULE_COMMIT_ID"
cd $GITHUB_WORKSPACE
STORED_COMMIT_ID=$(cat native-commit-id-linux)
echo "Stored commit ID: $STORED_COMMIT_ID"
if [ "$SUBMODULE_COMMIT_ID" != "$STORED_COMMIT_ID" ]; then
echo "Submodule has new commits. Triggering build."
echo "trigger_build=true" >> $GITHUB_OUTPUT
echo $SUBMODULE_COMMIT_ID > native-commit-id-linux
else
echo "No new commits in submodule."
echo "trigger_build=false" >> $GITHUB_OUTPUT
fi
- name: Install aarch64-linux-gnu-gcc
if: steps.check_submodule.outputs.trigger_build == 'true'
run: sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu && sudo apt-get install -y g++-aarch64-linux-gnu
- name: Install gcc-arm-linux-gnueabihf
if: steps.check_submodule.outputs.trigger_build == 'true'
run: sudo apt-get update && sudo apt-get install -y gcc-arm-linux-gnueabihf && sudo apt-get install -y g++-arm-linux-gnueabihf
- name: Install CUDA Toolkit
if: steps.check_submodule.outputs.trigger_build == 'true'
uses: Jimver/[email protected]
with:
cuda: '12.1.0'
- name: Run linux
if: steps.check_submodule.outputs.trigger_build == 'true'
run: make linux
- name: Remove CUDA installer
if: steps.check_submodule.outputs.trigger_build == 'true'
run: rm -rf cuda_installer-*
- name: Pull latest commits
if: steps.check_submodule.outputs.trigger_build == 'true'
run: git pull origin ${{ github.head_ref }}
- name: Commit and Push
if: steps.check_submodule.outputs.trigger_build == 'true'
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Add native changes linux