Skip to content

Commit

Permalink
CI: Add cmake-build.yml GitHub workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
henricj authored and mywave82 committed Jul 22, 2024
1 parent 889bfc8 commit baa126a
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: AdPlug CI
name: AdPlug autotools CI

on:
- push
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/cmake-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: AdPlug CMake CI

on: [ push, pull_request, workflow_dispatch ]

env:
libbinio_PRESET: default
libbinio_ROOT: '${{github.workspace}}/libbinio/out/install/default/lib/cmake/libbinio/'

jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ 'windows-latest', 'ubuntu-latest', 'macos-latest' ]

runs-on: ${{matrix.os}}

steps:
- name: Find libbinio repository
shell: bash
run: echo LIBBINIO_REPOSITORY="${GITHUB_REPOSITORY%/adplug}/libbinio" >> $GITHUB_ENV

- name: Get cmake and ninja
uses: lukka/get-cmake@latest

- name: Find MSVC (on Windows)
uses: ilammy/msvc-dev-cmd@v1

- name: Checkout libbinio repository
uses: actions/checkout@v3
with:
repository: '${{env.LIBBINIO_REPOSITORY}}'
ref: master
path: libbinio
fetch-depth: 0

- name: Checkout adplug repository
uses: actions/checkout@v3
with:
path: adplug
fetch-depth: 0

- name: Build libbinio
uses: lukka/run-cmake@v10
env:
VCPKG_ROOT:
# workaround for https://github.com/lukka/run-cmake/issues/142
with:
cmakeListsTxtPath: libbinio/CMakeLists.txt
configurePreset: '${{env.libbinio_PRESET}}'
buildPreset: '${{env.libbinio_PRESET}}'

- name: Install libbinio
working-directory: 'libbinio/out/build/${{env.libbinio_PRESET}}/'
run: cmake --install .

- name: Build adplug
uses: lukka/run-cmake@v10
env:
VCPKG_ROOT:
# workaround for https://github.com/lukka/run-cmake/issues/142
with:
cmakeListsTxtPath: adplug/CMakeLists.txt
configurePreset: default
buildPreset: default
testPreset: default

0 comments on commit baa126a

Please sign in to comment.