diff --git a/.github/workflows/IssuesCI.yml b/.github/workflows/IssuesCI.yml index 7868d33f..53081dbc 100644 --- a/.github/workflows/IssuesCI.yml +++ b/.github/workflows/IssuesCI.yml @@ -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 @@ -81,4 +46,21 @@ jobs: Commit Branch: ${{inputs.commitBranch}} Commit Author: ${{inputs.commitActor}} assignees: ${{inputs.commitActor}} - labels: build-failed \ No newline at end of file + 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 }} \ No newline at end of file diff --git a/.github/workflows/LinuxCI.yml b/.github/workflows/LinuxCI.yml index 473b9120..35f49f1a 100644 --- a/.github/workflows/LinuxCI.yml +++ b/.github/workflows/LinuxCI.yml @@ -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. diff --git a/CI/scripts/Issues.py b/CI/scripts/Issues.py new file mode 100644 index 00000000..ca47c3c7 --- /dev/null +++ b/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.") \ No newline at end of file diff --git a/Engine/Core/libs/Utils/CMakeLists.txt b/Engine/Core/libs/Utils/CMakeLists.txt index 8ffecf37..b62857d1 100644 --- a/Engine/Core/libs/Utils/CMakeLists.txt +++ b/Engine/Core/libs/Utils/CMakeLists.txt @@ -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}) diff --git a/Engine/Core/libs/Utils/inc/Utils/Platform/LinuxStacktraceImpl.h b/Engine/Core/libs/Utils/inc/Utils/Platform/LinuxStacktraceImpl.h index fa96bc52..2c4402e4 100644 --- a/Engine/Core/libs/Utils/inc/Utils/Platform/LinuxStacktraceImpl.h +++ b/Engine/Core/libs/Utils/inc/Utils/Platform/LinuxStacktraceImpl.h @@ -1,6 +1,11 @@ +#ifndef SRENGINE_LINUXSTACKTRACEIMPL_H +#define SRENGINE_LINUXSTACKTRACEIMPL_H + #include namespace SR_UTILS_NS { extern char* GetStacktraceImpl(); extern void StacktraceInitImpl(); -} \ No newline at end of file +} + +#endif // SRENGINE_LINUXSTACKTRACEIMPL_H \ No newline at end of file