name: Side-Channel Detection

on:
  push:
    branches: [ "master" ]
  pull_request:
    branches: [ "master" ]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
    - name: Install meson
      run: |
        sudo apt-get update
        sudo apt-get install -y meson
        sudo apt-get install -y valgrind
        sudo apt-get install -y gnu-efi
    - name: Meson setup build
      run: meson setup build -Dtimecop=enabled -Dslh_dsa_ascon_128s=enabled -Dslh_dsa_ascon_128f=enabled  -Dsbsigntools=enabled
    - name: Meson compile
      run: meson compile -C build
    - name: Meson test
      run: meson test --wrap='valgrind --vex-guest-max-insns=25 --track-origins=yes --error-exitcode=1' -C build --suite regression
    - name: Archive test logs
      if: always()
      uses: actions/upload-artifact@v4
      with:
        name: meson-logs
        path: build/meson-logs/
