Skip to content

Commit

Permalink
fix github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
DiaLight committed Jul 19, 2024
1 parent aff1870 commit 052d4d2
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,20 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: 'pip'
- name: Install dependencies
# cache: 'pip'
- uses: actions/cache@v4
id: cache-venv
with:
path: venv
key: setup-venv2-${{ runner.os }}-py-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}
restore-keys: |
setup-venv2-${{ runner.os }}-py-${{ steps.setup-python.outputs.python-version }}-
- name: Setup venv
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
python -m venv venv
venv/Scripts/python.exe -m pip install --upgrade pip setuptools wheel
venv/Scripts/python.exe -m pip install -r requirements.txt
if: steps.cache-venv.outputs.cache-hit != 'true'
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: win32
Expand All @@ -38,7 +47,8 @@ jobs:
- name: "cmake install"
shell: cmd
run: cd build && cmake --install .
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: flame
path: install/
if-no-files-found: error
5 changes: 1 addition & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ option(USE_CONFIGURE_DATE "Add configure date marker in output build")
# generate pdb to use debuggers with release builds
string(APPEND CMAKE_EXE_LINKER_FLAGS_RELEASE " /debug")

find_package(Python3 COMPONENTS Interpreter REQUIRED)
# force using python through venv
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/venv/Scripts/python.exe)
set(Python3_EXECUTABLE "${CMAKE_CURRENT_LIST_DIR}/venv/Scripts/python.exe")
# test for GitPython package installed
execute_process(COMMAND ${Python3_EXECUTABLE} -c "import git" RESULT_VARIABLE EXIT_CODE OUTPUT_QUIET)
else ()
# create venv
find_package(Python3 COMPONENTS Interpreter REQUIRED)
execute_process(COMMAND_ECHO STDOUT COMMAND ${Python3_EXECUTABLE} -m venv ${CMAKE_CURRENT_LIST_DIR}/venv )
set(Python3_EXECUTABLE "${CMAKE_CURRENT_LIST_DIR}/venv/Scripts/python.exe")
set(EXIT_CODE 1)
Expand Down Expand Up @@ -86,9 +86,6 @@ set(OUTPUT_SUFFIX "-${VER_PRODUCT_NUMBER}.${VER_PRODUCT_VERSION}.${VER_BUILD_NUM
if(CONFIGURE_DATE)
string(APPEND OUTPUT_SUFFIX "-${CONFIGURE_DATE}")
endif ()
if(GIT_SHA1)
string(APPEND OUTPUT_SUFFIX "-${GIT_SHORT_SHA1}")
endif()
add_subdirectory(src)

install(TARGETS dkii_flame RUNTIME DESTINATION ".")
Expand Down
3 changes: 3 additions & 0 deletions apply_patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ def main():
repo = git.Repo.init(repo_dir, initial_branch='main')
except git.exc.GitError:
repo = git.Repo.init(repo_dir, initial_branch='main')
with repo.config_writer() as w:
w.set_value("user", "name", "ember")
w.set_value("user", "email", "ember@users.noreply.github.com")
os.chdir(repo.working_dir)

# repo.git.am("--3way", *[f"../patches/{file.name}" for file in patches])
Expand Down
2 changes: 1 addition & 1 deletion rebuild_patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def cleanup_line(line: str):


def cleanup_patch(file: pathlib.Path):
print('cleanup ', file)
print('cleanup', file)
with open(file, 'r') as f:
lines = f.readlines()

Expand Down

0 comments on commit 052d4d2

Please sign in to comment.