Update ci setting #551
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_ENFORCE_SSE2=ON | |
-DSLEEF_BUILD_DFT=ON | |
-DSLEEF_ENFORCE_DFT=ON | |
-DSLEEF_BUILD_QUAD=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 g++-${GCC_VERSION} | |
- name: Build native | |
shell: bash -ex -o pipefail {0} | |
run: | | |
export LD_LIBRARY_PATH=$(pwd)/_install-native/lib | |
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@v4 | |
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@v4 | |
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: | | |
export LD_LIBRARY_PATH=$(pwd)/_install-native/lib | |
gcc docs/src/hellox86.c -static -o _examples-native/hellox86 -I_install-native/include -L_install-native/lib -lsleef -ltlfloat -lstdc++ | |
./_examples-native/hellox86 | |
- name: DFT example native | |
shell: bash -ex -o pipefail {0} | |
run: | | |
export LD_LIBRARY_PATH=$(pwd)/_install-native/lib | |
gcc docs/src/tutorial.c -static -o _examples-native/dft -I_install-native/include -L_install-native/lib -lsleefdft -lsleef -ltlfloat -lm -fopenmp -lstdc++ | |
./_examples-native/dft | |
./_examples-native/dft | |
- name: Upload examples-native artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: examples-native | |
path: | | |
_examples-native |