-
Notifications
You must be signed in to change notification settings - Fork 135
104 lines (86 loc) · 2.62 KB
/
build-examples.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
name: "Build & Test Examples"
on:
push:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
GCC_VERSION: "14"
COMMON_CMAKE_FLAGS: >
-DSLEEF_SHOW_CONFIG=ON
-DSLEEF_BUILD_GNUABI_LIBS=ON
-DSLEEF_BUILD_DFT=ON
-DSLEEF_BUILD_QUAD=OFF
-DSLEEF_BUILD_SCALAR_LIB=ON
-DSLEEF_BUILD_SHARED_LIBS=OFF
jobs:
build-native:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
name: build-native
steps:
- uses: actions/[email protected]
with:
persist-credentials: false
- name: Install dependencies
run: |
sudo apt-get update -y -qq
sudo apt-get install -y -qq build-essential cmake ninja-build gcc-${GCC_VERSION}
- name: Build native
shell: bash -ex -o pipefail {0}
run: |
cmake -S . -B _build-native -GNinja \
-DCMAKE_INSTALL_PREFIX=$(pwd)/_install-native \
-DCMAKE_TOOLCHAIN_FILE=$(pwd)/toolchains/native-gcc.cmake \
${COMMON_CMAKE_FLAGS}
cmake --build _build-native
cmake --install _build-native
- name: Upload build-native artifacts
uses: actions/upload-artifact@v3
with:
name: build-native
path: |
_build-*
_install-*
if: always()
examples-native:
runs-on: ubuntu-24.04
needs: [build-native]
strategy:
fail-fast: false
name: examples-native
steps:
- uses: actions/[email protected]
with:
persist-credentials: false
- name: Print host CPU info
run: |
cat /proc/cpuinfo
- name: Download build-native artifacts
uses: actions/download-artifact@v3
with:
name: build-native
- name: Create _examples-native directory
run: |
mkdir -p _examples-native
- name: Hello example native
shell: bash -ex -o pipefail {0}
run: |
gcc docs/src/hellox86.c -static -o _examples-native/hellox86 -I_install-native/include -L_install-native/lib -lsleef
./_examples-native/hellox86
- name: DFT example native
shell: bash -ex -o pipefail {0}
run: |
gcc docs/src/tutorial.c -static -o _examples-native/dft -I_install-native/include -L_install-native/lib -lsleef -lsleefdft -lsleefscalar -lm -fopenmp
./_examples-native/dft
./_examples-native/dft
- name: Upload examples-native artifacts
uses: actions/upload-artifact@v3
with:
name: examples-native
path: |
_examples-native