name: Windows user space CI

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

jobs:
  build:

    runs-on: windows-latest

    strategy:
      fail-fast: false
      matrix:
        include:
          #- { sys: mingw64, env: x86_64 }
          - { sys: ucrt64,  env: ucrt-x86_64 }
          #- { sys: clang64, env: clang-x86_64 }

    steps:
    - uses: actions/checkout@v3
    - uses: msys2/setup-msys2@v2
      with:
        msystem: ${{matrix.sys}}
        update: true
        install: git meson mingw-w64-${{matrix.env}}-meson mingw-w64-${{matrix.env}}-gcc
    - name: Meson setup
      run: msys2 -c 'meson setup build -Dslh_dsa_ascon_128s=enabled -Dslh_dsa_ascon_128f=enabled' -Dsbsigntools=disabled
    - name: Meson compile
      run: msys2 -c 'meson compile -C build'
    - name: Meson test
      run: msys2 -c 'meson test -C build --suite regression'
    - name: Archive test logs
      if: always()
      uses: actions/upload-artifact@v4
      with:
        name: meson-logs
        path: build/meson-logs/
