Skip to content

Commit

Permalink
fix(CI): Fix PR Validation pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
FiniteReality authored Mar 3, 2022
1 parent 3c69680 commit e9e5e85
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
os: [ windows-latest, ubuntu-latest ]
lua: [ "5.1", "5.2" ]
lua: [ "5.1", "5.2", "5.3", "5.4" ]

steps:
- uses: actions/checkout@v2
Expand All @@ -20,19 +20,20 @@ jobs:
shell: bash
run: |
cmake \
-DCMAKE_BUILD_TYPE="Debug" \
-DCMAKE_INSTALL_PREFIX=inst \
-DFABULIST_LUA_VERSION="${{ matrix.lua }}" \
-DFABULIST_ALL_ON=ON \
-Wdev -Wdeprecated -Werror=dev -Werror=deprecated -S . -B build
- name: Build Fabulist
run: cmake --build build --parallel --verbose
run: cmake --build build --parallel --config Debug --verbose

- name: Generate artifact
run: cmake --install build --verbose
run: cmake --install build --config Debug --verbose

- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: fabulist-pr-${{ matrix.os }}
name: fabulist-pr-${{ matrix.os }}-lua${{ matrix.lua }}
path: inst
20 changes: 18 additions & 2 deletions cmake/modules/GitVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,23 @@ function(extract_git_version prefix)
endif()

execute_process(
COMMAND "${GIT_PROGRAM}" describe --tags --abbrev=0
COMMAND "${GIT_PROGRAM}" rev-list --tags --max-count=1
OUTPUT_VARIABLE _git_tag_sha
RESULT_VARIABLE _git_has_tag
)

string(STRIP "${_git_tag_sha}" _git_tag_sha)

if (NOT ${_git_has_tag} EQUAL 0)
set(${prefix}_VERSION_STRING "0.0.0-unknown" PARENT_SCOPE)
set(${prefix}_VERSION_MAJOR 0 PARENT_SCOPE)
set(${prefix}_VERSION_MINOR 0 PARENT_SCOPE)
set(${prefix}_VERSION_PATCH 0 PARENT_SCOPE)
return()
endif()

execute_process(
COMMAND "${GIT_PROGRAM}" describe --tags "${_git_tag_sha}"
OUTPUT_VARIABLE _git_tag
)
execute_process(
Expand All @@ -42,7 +58,7 @@ function(extract_git_version prefix)
string(REGEX REPLACE [[[0-9]+\.([0-9]+)\.[0-9]+]] "\\1" _git_version_minor "${_git_version}")
string(REGEX REPLACE [[[0-9]+\.[0-9]+\.([0-9]+)]] "\\1" _git_version_patch "${_git_version}")

if(_git_staged_changes OR _git_unstaged_changes)
if(${_git_staged_changes} OR ${_git_unstaged_changes})
set(${prefix}_VERSION_STRING "${_git_version}-dirty+${_git_sha}" PARENT_SCOPE)
else()
set(${prefix}_VERSION_STRING "${_git_version}+${_git_sha}" PARENT_SCOPE)
Expand Down

0 comments on commit e9e5e85

Please sign in to comment.