summaryrefslogblamecommitdiffstats
path: root/.github/workflows/build-programs.yml
blob: 06642b5fed02b6720d31428df8fd1a904ca007f1 (plain) (tree)
1
2
3
4
5
6
7
                          





               






                      

                                                 


                                        

                                                                  


                                       

                                                   


                                        

                                                                    


                                       

                                                             









                                               
                                                    

                                                             
                                                    
                                       
                                 






                                                                     
                                            
                                       




                                                                                 
name: Build dnbd3 programs

on:
  push:
    branches:
      - master
  pull_request:

jobs:
  build:
    strategy:
      fail-fast: false
      matrix:
        config:
          - name: debug [default] on Ubuntu 22.04
            build-os: ubuntu-22.04
            build-type: "Debug"
            build-cfg-server-fuse: "OFF"
            build-cfg-harden: "OFF"
          - name: debug [server with fuse support] on Ubuntu 22.04
            build-os: ubuntu-22.04
            build-type: "Debug"
            build-cfg-server-fuse: "ON"
            build-cfg-harden: "OFF"
          - name: release [default] on Ubuntu 22.04
            build-os: ubuntu-22.04
            build-type: "Release"
            build-cfg-server-fuse: "OFF"
            build-cfg-harden: "OFF"
          - name: release [server with fuse support] on Ubuntu 22.04
            build-os: ubuntu-22.04
            build-type: "Release"
            build-cfg-server-fuse: "ON"
            build-cfg-harden: "OFF"
          - name: release [default hardening] on Ubuntu 22.04
            build-os: ubuntu-22.04
            build-type: "Release"
            build-cfg-server-fuse: "OFF"
            build-cfg-harden: "ON"
    name: Build dnbd3 ${{ matrix.config.name }}
    runs-on: ${{ matrix.config.build-os }}
    steps:
      - name: Install dnbd3 dependencies
        run: |
          sudo apt-get update -y -qq
          sudo apt-get install -y -qq make \
                                      clang-format \
                                      linux-headers-generic \
                                      libfuse-dev \
                                      libjansson-dev
      - name: Checkout dnbd3 repository
        uses: actions/checkout@v4
      - name: Fetch dnbd3 repository tags
        run: git fetch --prune --unshallow
      - name: Configure dnbd3 build
        run: |
          cmake -B ${{ github.workspace }}/build \
                -S ${{ github.workspace }} \
                -D CMAKE_BUILD_TYPE=${{ matrix.config.build-type }} \
                -D DNBD3_KERNEL_MODULE=OFF \
                -D DNBD3_BENCHMARK=ON \
                -D DNBD3_SERVER_FUSE=${{ matrix.config.build-cfg-server-fuse }} \
                -D DNBD3_RELEASE_HARDEN=${{ matrix.config.build-cfg-harden }}
      - name: Build dnbd3 artifacts
        working-directory: ${{ github.workspace }}/build
        run: make