DO NOT MERGE: focus test builds #3717
Workflow file for this run
This file contains 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: CI | |
on: | |
push: | |
branches-ignore: | |
- 'master' | |
- 'ci/**' | |
- '!ci/gha**' | |
pull_request: | |
branches: | |
- 'master' | |
concurrency: | |
group: build-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
checkinstall: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- name: Install APT Dependencies | |
run: | | |
sudo apt-get install -y ninja-build ninja-build pipx | |
pipx install meson==0.55.0 | |
- run: | | |
meson setup build --prefix $PWD/install -Dtests=false | |
meson install -C build --quiet | |
diff <(find simde/ -type f -name "*.h") <(cd install/include/; find simde -type f -name "*.h" ) | |
formatting: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- name: Install pcre2grep | |
run: sudo apt-get update && sudo apt-get install -y pcre2-utils | |
# Check for trailing whitespace | |
- name: Trailing whitespace | |
run: find simde/ \( -name '*.c' -o -name '*.h' \) -exec grep -nP '\s+$' {} + && exit 1 || exit 0 | |
# We use spaces, not tabs. I don't want to start a holy war here; | |
# I don't actually have a strong preference between the two, but I | |
# do have a strong preference for consistency, so don't @ me. | |
- name: Tabs | |
run: find simde/ \( -name '*.c' -o -name '*.h' \) -exec grep -nP '\t' {} + && exit 1 || exit 0 | |
# s/8/16/ will result in this if the input is x86. | |
- name: Bad substitutions | |
run: git grep -i 'x''1''6''6' && exit 1 || exit 0 | |
- name: Incorrect assertions in test/ | |
run: grep -PR '(?<=[^a-zA-Z0-9_])simde_assert_u?int(8|16|32|64)(?>[^a-zA-Z0-9_])' test/ && exit 1 || exit 0 | |
# Check to make sure no source files have the executable bit set | |
- name: Executable sources | |
run: find \( -name '*.c' -o -name '*.h' \) -executable | grep -q '.' && exit 1 || exit 0 | |
# Make sure neon.h includes all the NEON headers. | |
- name: Missing NEON includes | |
run: for f in simde/arm/neon/*.h; do grep -q "include \"neon/$(basename "$f")\"" simde/arm/neon.h || (echo "Missing $f" && exit 1); done | |
# Make sure sve.h includes all the SVE headers. | |
- name: Missing SVE includes | |
run: for f in simde/arm/sve/*.h; do grep -q "include \"sve/$(basename "$f")\"" simde/arm/sve.h || (echo "Missing $f" && exit 1); done | |
# Make sure msa.h includes all the MSA headers. | |
- name: Missing MSA includes | |
run: for f in simde/mips/msa/*.h; do grep -q "include \"msa/$(basename "$f")\"" simde/mips/msa.h || (echo "Missing $f" && exit 1); done | |
# Make sure we can find the expected header guards. It's easy to miss this when doing C&P | |
- name: Header guards | |
run: for file in $(find simde/*/ -name '*.h'); do grep -q "$(echo "$file" | tr '[:lower:]' '[:upper:]' | tr '[:punct:]' '_')" "$file" || (echo "Missing or incorrect header guard in $file" && exit 1); done | |
# There should be an empty line at the end of every file | |
- name: Newline at EOF | |
run: for file in $(find simde -name '*.h'); do if [ -n "$(tail -c 1 "$file")" ]; then echo "No newline at end of $file" && exit 1; fi; done | |
# Don't #ifndef ; use !defined(...) instead. ifndef leads to annoying inconsistencies | |
- name: ifndef | |
run: for file in $(find simde -name '*.h'); do grep -qP '^ *# *ifndef ' "${file}" && exit 1 || exit 0; done | |
# List of headers we want Meson to install | |
- name: Meson install headers | |
run: for file in $(find simde -name '*.h'); do grep -qF "$(basename "${file}" .h)" meson.build || (echo "${file} missing from top-level meson.build" && exit 1); done | |
# Make sure we don't accidentally use `vector ...` instead of SIMDE_POWER_ALTIVEC_VECTOR(...) | |
- name: AltiVec raw vector keyword | |
run: find simde/ \( -name '*.c' -o -name '*.h' \) -exec grep -nP 'vector( +)((bool|signed|unsigned) +)?(double|float|long long|long|int|short|char)' {} + && exit 1 || exit 0 | |
# Check indentation of preprocessor directives. | |
- name: Preprocessor directive indentation | |
run: find simde/*/ -name 'avx*.h' -exec pcre2grep -M '{\n#' {} + && exit 1 || exit 0 | |
- name: Stray `&& 0` | |
run: git grep ' && 0' simde/ test/ && exit 1 || exit 0 | |
x86: | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
isax: | |
- -mavx512bw -mavx512vl -DSIMDE_NATURAL_VECTOR_SIZE=256 | |
# https://en.wikipedia.org/wiki/X86-64#Microarchitecture_levels | |
- -march=x86-64 # CMOV, CX8, FPU, FXSR, MMX, OSFXSR, SCE, SSE, SSE2 | |
- -march=x86-64-v2 # CMPXCHG16B, LAHF-SAHF, POPCNT, SSE3, SSE4_1, SSE4_2, SSSE3 | |
- -march=x86-64-v3 # AVX, AVX2, BMI1, BMI2, F16C, FMA, LZCNT, MOVBE, OSXSAVE | |
- -march=x86-64-v4 # AVX512F, AVX512BW, AVX512CD, AVX512DQ, AVX512VL a.k.a. skylake+ (including zen4) | |
- -march=x86-64-v4 -mavx512vpopcntdq -mavx512ifma -mavx512vbmi -mavx512vnni -mavx512vbmi2 -mavx512bitalg -mvpclmulqdq -mgfni -mvaes # icelake+ (including zen4) | |
- -maes | |
- -mpclmul | |
include: | |
- target: tgl | |
- isax: -mavx512f -mavx512cd -mavx512vl -mavx512dq -mavx512bw -mavx512vpopcntdq -mavx512ifma -mavx512vbmi -mavx512vnni -mavx512vbmi2 -mavx512bitalg -mvpclmulqdq -mgfni -mvaes -mavx512bf16 -mavx512fp16 # sapphire rapids (16 bit floating point, "bf" and regular) | |
target: spr | |
env: | |
CFLAGS: -Wall -Wextra -Werror ${{ matrix.isax }} | |
CXXFLAGS: -Wall -Wextra -Werror ${{ matrix.isax }} | |
INTEL_TARGET: ${{ matrix.target }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: CPU Information | |
run: cat /proc/cpuinfo | |
- run: sudo apt-get update | |
- name: ccache | |
uses: hendrikmuhs/[email protected] | |
with: | |
key: ${{ github.job }}-${{ matrix.isax }} | |
- name: Install APT Dependencies | |
run: | | |
sudo apt-get install -y ninja-build ninja-build python3-pip parallel gcovr g++-12 gcc-12 | |
sudo apt-get purge -y gcc g++ | |
sudo ln -s /usr/bin/gcc-12 /usr/bin/gcc | |
sudo ln -s /usr/bin/g++-12 /usr/bin/g++ | |
sudo python3 -m pip install meson==0.55.0 | |
- name: add ccache to the build path | |
run: | | |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | |
- name: Configure | |
run: meson setup build -Db_coverage=true || (cat build/meson-logs/meson-log.txt ; false) | |
- name: Build | |
run: ninja -C build -v | |
- name: Test | |
run: meson test -C build --print-errorlogs --wrapper "${GITHUB_WORKSPACE}/test/check-flags.sh sde" $(meson test -C build --list | grep -v emul) | |
- name: Coverage Report | |
run: ninja -C build -v coverage-xml | |
- name: CodeCov.io | |
uses: codecov/codecov-action@v3 | |
with: | |
file: ./build/meson-logs/coverage.xml |