Skip to content

no message

no message #447

Workflow file for this run

name: "Linux Build & Test"
on:
push:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
GCC_VERSION: "14"
LLVM_VERSION: "17"
COMMON_CMAKE_FLAGS: >
-DSLEEF_SHOW_CONFIG=1
-DSLEEF_BUILD_GNUABI_LIBS=ON
-DSLEEF_BUILD_INLINE_HEADERS=ON
-DSLEEF_BUILD_DFT=ON
-DSLEEF_BUILD_QUAD=ON
-DSLEEF_BUILD_SCALAR_LIB=ON
-DSLEEF_BUILD_STATIC_TEST_BINS=ON
-DSLEEF_ENFORCE_TESTER3=ON
-DSLEEF_ENABLE_TESTER4=ON
-DSLEEF_ENABLE_TESTER=OFF
-DSLEEF_ENFORCE_TESTER=OFF
jobs:
build-native:
# Native Build and Test run on a range of runners
# - Github hosted, only Linux x86.
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04]
compiler: [gcc, llvm]
name: build-native-${{ matrix.os }}-${{ matrix.compiler }}
steps:
- uses: actions/checkout@v4.1.1
with:
persist-credentials: false
- name: Install dependencies
run: |
sudo apt-get update -y -qq
sudo apt-get install -y -qq build-essential cmake curl ninja-build libgmp-dev libmpfr-dev libssl-dev
# Needed for llvm builds as well for target libraries
# Use default gcc version on Arm-hosted runners, ie. gcc 11,
# since versions of 12+ are not recent enough on Ubuntu 22.04.
- name: Install gcc
if: ${{ matrix.os == 'ubuntu-24.04' }}
run: |
sudo apt-get install -y -qq gcc-${GCC_VERSION}
- name: Install llvm
run: |
curl -o llvm.sh https://apt.llvm.org/llvm.sh
chmod u+x llvm.sh
sudo ./llvm.sh ${LLVM_VERSION}
sudo ln -srf $(which clang-${LLVM_VERSION}) /usr/bin/clang
rm llvm.sh
if: ${{ matrix.compiler == 'llvm' }}
- name: Set x86_64 config
shell: bash -ex -o pipefail {0}
if: ${{ matrix.os == 'ubuntu-24.04' }}
run: |
export EXTRA_CMAKE_FLAGS="\
-DSLEEF_ENFORCE_SSE2=ON -DSLEEF_ENFORCE_SSE4=ON \
-DSLEEF_ENFORCE_AVX=ON -DSLEEF_ENFORCE_AVX2=ON \
-DSLEEF_ENFORCE_AVX512F=ON -DSLEEF_ENFORCE_FMA4=ON"
- name: Set AArch64 Neon config
shell: bash -ex -o pipefail {0}
if: contains(matrix.os, 'c6g')
run: |
export EXTRA_CMAKE_FLAGS=""
- 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-${{ matrix.compiler }}.cmake \
${COMMON_CMAKE_FLAGS} \
${EXTRA_CMAKE_FLAGS}
cmake --build _build-native
cmake --install _build-native
- name: Upload build-native-${{ matrix.os }}-${{ matrix.compiler }} artifacts
uses: actions/upload-artifact@v4
with:
name: build-native-${{ matrix.os }}-${{ matrix.compiler }}
path: |
_build-*
_install-*
if: always()
test-native:
runs-on: ${{ matrix.os }}
needs: [build-native]
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04]
compiler: [gcc, llvm]
name: test-native-${{ matrix.os }}-${{ matrix.compiler }}
steps:
- uses: actions/checkout@v4.1.1
with:
persist-credentials: false
- name: Install dependencies
run: sudo apt-get update -y -qq && sudo apt-get install -y -qq cmake libgmp-dev libmpfr-dev libssl-dev
- name: Print host CPU info
run: |
cat /proc/cpuinfo
- name: Download build-native-${{ matrix.os }}-${{ matrix.compiler }} artifacts
uses: actions/download-artifact@v4
with:
name: build-native-${{ matrix.os }}-${{ matrix.compiler }}
- name: Fix _build-native permissions
run: |
chmod +x _build-native/bin/*
- name: Test native
env:
CTEST_OUTPUT_ON_FAILURE: "TRUE"
run: |
cd _build-native
ctest -j$(nproc)
- name: Upload test-native artifacts
uses: actions/upload-artifact@v4
with:
name: test-native-${{ matrix.os }}-${{ matrix.compiler }}
path: |
_build-native/Testing
if: always()