mirror of
https://github.com/WerWolv/ImHex-Patterns.git
synced 2026-03-27 23:37:04 -05:00
git: Add option to customize pattern language repo and git hash with workflow call
This commit is contained in:
7
.github/workflows/tests.yml
vendored
7
.github/workflows/tests.yml
vendored
@@ -8,6 +8,11 @@ on:
|
||||
repository_dispatch:
|
||||
types: [run_tests]
|
||||
workflow_call:
|
||||
inputs:
|
||||
pattern_language_git_repo:
|
||||
type: string
|
||||
pattern_language_git_hash:
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
@@ -63,6 +68,8 @@ jobs:
|
||||
-DIMHEX_PATTERNS_ENABLE_UNIT_TESTS=ON \
|
||||
-DLIBPL_ENABLE_TESTS=OFF \
|
||||
-DLIBPL_ENABLE_CLI=OFF \
|
||||
-DIMHEX_PATTERNS_LIBPL_GIT_REPO="${{ inputs.pattern_language_git_repo }}" \
|
||||
-DIMHEX_PATTERNS_LIBPL_GIT_HASH="${{ inputs.pattern_language_git_hash }}" \
|
||||
-G Ninja \
|
||||
..
|
||||
ninja unit_tests
|
||||
|
||||
@@ -16,10 +16,22 @@ endif()
|
||||
if(NOT TARGET libpl)
|
||||
include(FetchContent)
|
||||
|
||||
if (NOT DEFINED DIMHEX_PATTERNS_LIBPL_GIT_REPO OR DIMHEX_PATTERNS_LIBPL_GIT_REPO STREQUAL "")
|
||||
set(LIBPL_GIT_REPO "https://github.com/WerWolv/PatternLanguage")
|
||||
else()
|
||||
set(LIBPL_GIT_REPO ${DIMHEX_PATTERNS_LIBPL_GIT_REPO})
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED IMHEX_PATTERNS_LIBPL_GIT_HASH OR IMHEX_PATTERNS_LIBPL_GIT_HASH STREQUAL "")
|
||||
set(LIBPL_GIT_TAG "master")
|
||||
else()
|
||||
set(LIBPL_GIT_TAG ${IMHEX_PATTERNS_LIBPL_GIT_HASH})
|
||||
endif()
|
||||
|
||||
FetchContent_Declare(
|
||||
pattern_language
|
||||
GIT_REPOSITORY https://github.com/WerWolv/PatternLanguage
|
||||
GIT_TAG master
|
||||
GIT_REPOSITORY ${LIBPL_GIT_REPO}
|
||||
GIT_TAG ${LIBPL_GIT_TAG}
|
||||
)
|
||||
|
||||
FetchContent_MakeAvailable(pattern_language)
|
||||
|
||||
Reference in New Issue
Block a user