Skip to content

Commit

Permalink
Add CMake to GitHub build.
Browse files Browse the repository at this point in the history
  • Loading branch information
henricj authored and mywave82 committed Jul 9, 2024
1 parent d5c7d71 commit 177668b
Showing 1 changed file with 45 additions and 15 deletions.
60 changes: 45 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ jobs:
os: ubuntu-latest
- compiler: djgpp-2.0.5-gcc-4.8.5 # To test compatibility for Adplay - DOS
os: ubuntu-latest
- compiler: cmake
os: ubuntu-latest
- compiler: cmake
os: macos-latest
- compiler: cmake
os: windows-latest

fail-fast: false

Expand All @@ -27,8 +33,8 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install packages (Linux)
if: ${{ runner.os == 'Linux' }}
- name: Install packages (autotools, Linux)
if: ${{ runner.os == 'Linux' && matrix.compiler != 'cmake'}}
run: |
sudo apt update
sudo apt install -y texlive-latex-base texinfo
Expand Down Expand Up @@ -63,8 +69,8 @@ jobs:
fi
fi
- name: Install packages (macOS)
if: ${{ runner.os == 'macOS' }}
- name: Install packages (autotools, macOS)
if: ${{ runner.os == 'macOS' && matrix.compiler != 'cmake'}}
run: |
# Allow core dumps
sudo sh -c 'touch /cores/test && rm /cores/test && chmod -R 0777 /cores'
Expand All @@ -73,36 +79,39 @@ jobs:
#brew install --cask mactex-no-gui
brew install automake libtool texinfo
- name: Install LLVM and Clang
if: ${{ matrix.compiler == 'clang' && runner.os != 'macOS' }}
- name: Install LLVM and Clang (autotools)
if: ${{ matrix.compiler == 'clang' && runner.os != 'macOS'}}
uses: KyleMayes/install-llvm-action@v1
with:
version: "10.0"

- name: Set GCC-4.8 environment
- name: Set GCC-4.8 environment (autotools)
if: ${{ matrix.compiler == 'gcc-4.8' }}
run: echo 'compile_opts=CC=gcc-4.8 CXX=g++-4.8' >> $GITHUB_ENV

- name: Set GCC environment
- name: Set GCC environment (autotools)
if: ${{ matrix.compiler == 'gcc' && runner.os == 'macOS' }}
run: echo 'compile_opts=CC=gcc CXX=g++' >> $GITHUB_ENV

- name: Set Clang environment
- name: Set Clang environment (autotools)
if: ${{ matrix.compiler == 'clang' }}
run: echo 'compile_opts=CC=clang CXX=clang++' >> $GITHUB_ENV

- name: Set DJGPP environment
- name: Set DJGPP environment (autotools)
if: ${{ startsWith(matrix.compiler, 'djgpp') }}
run: |
echo 'compile_opts=--host=i586-pc-msdosdjgpp --prefix=/usr/local/djgpp CXXFLAGS=-Wno-deprecated CPPFLAGS=-Wno-deprecated PKG_CONFIG_PATH=/usr/local/djgpp/lib/pkgconfig' >> $GITHUB_ENV
echo 'usr/local//djgpp/bin/' >> $GITHUB_PATH
- name: autoreconf
- name: autoreconf (autotools)
if: ${{matrix.compiler != 'cmake'}}
run: autoreconf -i
- name: configure
- name: configure (autotools)
if: ${{matrix.compiler != 'cmake'}}
run: ./configure ${{ env.compile_opts }} || cat config.log

- name: make
- name: make (autotools)
if: ${{matrix.compiler != 'cmake'}}
run: |
ulimit -c unlimited -S
if [[ ${{ runner.os }} == "macOS" ]]; then
Expand All @@ -122,6 +131,27 @@ jobs:
make distcheck ${{ env.compile_opts }}
fi
- name: Prepare test results (Linux)
if: ${{ runner.os == 'Linux' && !startsWith(matrix.compiler, 'djgpp')}}
- name: Prepare test results (autotools, Linux)
if: ${{ runner.os == 'Linux' && !startsWith(matrix.compiler, 'djgpp') && matrix.compiler != 'cmake'}}
run: make check

- name: Get cmake and ninja (cmake)
if: ${{matrix.compiler == 'cmake'}}
uses: lukka/get-cmake@latest

- name: Find MSVC (cmake on Windows)
if: ${{matrix.compiler == 'cmake'}}
uses: ilammy/msvc-dev-cmd@v1

- name: Checkout repository (cmake)
if: ${{matrix.compiler == 'cmake'}}
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Build (cmake)
if: ${{matrix.compiler == 'cmake'}}
uses: lukka/run-cmake@v10
with:
configurePreset: shared
buildPreset: shared

0 comments on commit 177668b

Please sign in to comment.