Skip to content

Commit

Permalink
(Build) Fixed Windows and Linux builds.
Browse files Browse the repository at this point in the history
#SR_CLOSE(64, 62, 56)
  • Loading branch information
innerviewer committed Nov 13, 2023
1 parent 59c318a commit 4fca16a
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 39 deletions.
54 changes: 18 additions & 36 deletions .github/workflows/IssuesCI.yml
Expand Up @@ -32,41 +32,6 @@ jobs:
pip install PyGithub
name: Installing dependencies.
- name: Closing the issues.
shell: python
id: script
run: |
import os
import re
from github import Github
from github import Auth
commitMessage = os.getenv('commitMessage')
commitSha = os.getenv('commitSha')
token = os.getenv('ciToken')
print("Trying to login to GitHub and get the repository")
auth = Auth.Token(token)
g = Github(auth=auth)
repo = g.get_repo("SpaRcle-Studio/SREngine")
print(f"Commit message:\n{commitMessage}\n")
regexClose = re.search('#SR_CLOSE((.*))', commitMessage)
closeMacros = regexClose.group(1)
closeMacros = closeMacros[1:][:-1]
closeMacros = closeMacros.replace(' ', '')
issueIds = closeMacros.split(",")
print(f"Issue Ids are: {issueIds}")
for issueId in issueIds:
print(f"Trying to get issue: {issueId}")
issue = repo.get_issue(int(issueId))
print(f"Creating comment and closing issue: {issueId}")
issue.create_comment(f"Issue is closed automatically by CI. Commit: {commitSha}")
issue.edit(state='closed')
print(f"Success for issue: {issueId}")
print(f"Script execution is finished.")
env:
commitMessage: ${{ inputs.commitMessage }}
ciToken: ${{ secrets.CITOKEN }}
commitSha: ${{ inputs.commitSha }}

- if: inputs.linuxBuildState == 'failure' || inputs.windowsBuildState == 'failure'
name: Creating an issue.
uses: dacbd/create-issue-action@main
Expand All @@ -81,4 +46,21 @@ jobs:
Commit Branch: ${{inputs.commitBranch}}
Commit Author: ${{inputs.commitActor}}
assignees: ${{inputs.commitActor}}
labels: build-failed
labels: build-failed

- name: Fetching repository.
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Closing the issues.
if: inputs.linuxBuildState != 'failure' && inputs.windowsBuildState != 'failure'
id: script
shell: bash
working-directory: ${{github.workspace}}/CI/scripts
run: |
python ./Issues.py
env:
commitMessage: ${{ inputs.commitMessage }}
ciToken: ${{ secrets.CITOKEN }}
commitSha: ${{ inputs.commitSha }}
2 changes: 1 addition & 1 deletion .github/workflows/LinuxCI.yml
Expand Up @@ -29,7 +29,7 @@ jobs:
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list http://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
sudo apt update
sudo apt-get install -y libgtk-3-0 cmake build-essential libgtk-3-dev libx11-dev
sudo apt-get install -y xcb libxcb-xkb-dev x11-xkb-utils libx11-xcb-dev libxkbcommon-x11-dev libxtst-dev libxcb-ewmh-dev
sudo apt-get install -y xcb libxcb-xkb-dev x11-xkb-utils libx11-xcb-dev libxkbcommon-x11-dev libxtst-dev libxcb-ewmh-dev binutils-dev
sudo apt install vulkan-sdk
- name: Updating submodules.
Expand Down
45 changes: 45 additions & 0 deletions CI/scripts/Issues.py
@@ -0,0 +1,45 @@
try:
import os
import re
from github import Github
from github import Auth
except ImportError:
print("Import exception occurred!")
exit(-1)

commitMessage = os.getenv('commitMessage')
commitSha = os.getenv('commitSha')
token = os.getenv('ciToken')

try:
print("Trying to login to GitHub and get the repository")
auth = Auth.Token(token)
g = Github(auth=auth)
repo = g.get_repo("SpaRcle-Studio/SREngine")
except Exception as e:
print(f"GitHub login exception occurred: {str(e)}")
exit(-1)

print(f"Commit message:\n{commitMessage}\n")
try:
regexClose = re.search('#SR_CLOSE(.*)', commitMessage)
closeMacros = regexClose.group(1)
closeMacros = closeMacros[1:][:-1]
closeMacros = closeMacros.replace(' ', '')
issueIds = closeMacros.split(",")
print(f"Issue Ids are: {issueIds}")
except Exception as e:
print(f"Regex error occurred: {str(e)}")
exit(-1)

for issueId in issueIds:
try:
print(f"Trying to get issue: {issueId}")
issue = repo.get_issue(int(issueId))
print(f"Creating comment and closing issue: {issueId}")
issue.create_comment(f"Issue is closed automatically by CI. Commit: {commitSha}")
issue.edit(state='closed')
print(f"Success for issue: {issueId}")
except Exception as e:
print(f"Issue managing exception occurred: {str(e)}")
print(f"Script execution is finished.")
5 changes: 4 additions & 1 deletion Engine/Core/libs/Utils/CMakeLists.txt
Expand Up @@ -45,7 +45,10 @@ list(APPEND SR_UTILS_LINK_LIBRARIES cxx/ECS.cxx)
list(APPEND SR_UTILS_LINK_LIBRARIES cxx/World.cxx)
list(APPEND SR_UTILS_LINK_LIBRARIES cxx/Platform.cxx)
list(APPEND SR_UTILS_LINK_LIBRARIES cxx/Types.cxx)
list(APPEND SR_UTILS_LINK_LIBRARIES src/Utils/Platform/LinuxStacktraceImpl.cpp)

if (UNIX)
list(APPEND SR_UTILS_LINK_LIBRARIES src/Utils/Platform/LinuxStacktraceImpl.cpp)
endif ()

if (SR_UTILS_STATIC_LIBRARY)
add_library(Utils STATIC ${SR_UTILS_LINK_LIBRARIES})
Expand Down
@@ -1,6 +1,11 @@
#ifndef SRENGINE_LINUXSTACKTRACEIMPL_H
#define SRENGINE_LINUXSTACKTRACEIMPL_H

#include <Utils/macros.h>

namespace SR_UTILS_NS {
extern char* GetStacktraceImpl();
extern void StacktraceInitImpl();
}
}

#endif // SRENGINE_LINUXSTACKTRACEIMPL_H

0 comments on commit 4fca16a

Please sign in to comment.