Skip to content

LMR earlier

LMR earlier #177

Workflow file for this run

name: Validate Bench & Run Tests
on: [push]
jobs:
WhiteCore:
runs-on: ${{matrix.os}}
name: WhiteCore ${{matrix.compiler}} ${{matrix.arch}} ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
arch: [popcnt, avx2, bmi2]
compiler: [g++, clang++]
include:
- os: ubuntu-latest
suffix: "-linux"
debug-build: "build=debug"
packages: |
sudo apt-get update
sudo apt-get install -y valgrind clang-15 g++-multilib
- os: windows-latest
suffix: "-win"
exe-suffix: ".exe"
steps:
- uses: actions/checkout@v3
- name: Install required packages
if: matrix.os == 'ubuntu-latest'
run: ${{ matrix.packages }}
- name: Build WhiteCore
run: |
${{matrix.compiler}} --version
make EXE=WhiteCore-${{matrix.arch}}${{matrix.suffix}} ARCH=${{matrix.arch}} CXX=${{matrix.compiler}} ${{matrix.debug-build}}
- name: Run tests
run: ./WhiteCore-${{matrix.arch}}${{matrix.suffix}} test
- name: Run bench on Windows
if: matrix.os == 'windows-latest'
run: ./WhiteCore-${{matrix.arch}}${{matrix.suffix}} bench
- name: Run bench on Linux
id: obtain_bench
if: matrix.os == 'ubuntu-latest'
run: |
BENCH=$(./WhiteCore-${{matrix.arch}}${{matrix.suffix}} bench | grep -Eo '^[0-9]+ nodes' | grep -o '[0-9]*')
COMMIT_BENCH=$(git log -1 --pretty=%B | grep -Eo '^Bench: *[0-9]+' | grep -o '[0-9]*')
echo "BENCH=$BENCH" >> $GITHUB_ENV
echo "COMMIT_BENCH=$COMMIT_BENCH" >> $GITHUB_ENV
- name: Invalid bench
if: steps.obtain_bench.outputs.BENCH != steps.obtain_bench.outputs.COMMIT_BENCH &&
matrix.os == 'ubuntu-latest'
run: |
echo "::error::The commit bench ${{steps.obtain_bench.outputs.COMMIT_BENCH}} is not equal to the actual bench ${{steps.obtain_bench.outputs.BENCH}}!"
exit 1
- name: Run Valgrind
if: runner.os == 'Linux'
run: |
valgrind --error-exitcode=1 --errors-for-leak-kinds=all --leak-check=full ./WhiteCore-${{matrix.arch}}${{matrix.suffix}} bench
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: WhiteCore-${{matrix.arch}}-${{matrix.compiler}}${{matrix.suffix}}${{matrix.exe-suffix}}
path: ./WhiteCore-${{matrix.arch}}${{matrix.suffix}}${{matrix.exe-suffix}}