name: Fedora/Rawhide

on:
  schedule:
    - cron: "0 0 25 * *"
  push:
  pull_request:
  workflow_dispatch:

permissions:
  contents: read

jobs:
  build_and_test:
    strategy:
      matrix:
        cc: [ gcc, clang ]
    name: ${{ matrix.cc }}
    runs-on: ubuntu-latest
    container:
      image: fedora:rawhide
    steps:
    - uses: actions/checkout@v1
      with:
        submodules: true
    - name: Install dependencies
      run: |
        dnf -y install git cmake ncurses-devel openssl-devel-engine libsodium-devel readline-devel zlib-devel gcc-c++ clang google-cpu_features-devel
    - name: Compile with ${{ matrix.cc }}
      run: |
        export CC=${{ matrix.cc }}
        CMAKE_FLAGS="-DUSE_SYSTEM_CPU_FEATURES=1" CFLAGS="-I/usr/include/cpu_features" ./configure
        make -C build

