Skip to content

Commit 5531c40

Browse files
authored
Fix github actions, cmake rework and integrate with vcpkg and improvement on protobuf (#257)
Full Github Action Rework (GHA), so that builds are fixed: Windows, Linux, Docker; Review checks: C++, Lua, XML and others checks Complete Cmake Rework, modernized the code so that you can work with GHA. Removed: VCPKG Build Removed generated Files from file .gitignore (all build files are required for Cmake cache generation) Lib Lua5.1 was removed and maintained only Luajit (faster and better) Removed the "consoleapplication" file Removed the "lbitlib" file, after all, if the idea is the project to use updated Libs, why do we want files that bring compatibility to old Libs? I just updated the files to use the functions of the new LIBs Modified: The metadata of the Bitwise functions have been changed, now being in place of "bit32." is "bit." Protobuf will now be chased along with the client build, avoiding random errors related to Protobuf's version is different from the compiled file (this way, no matter if the repository file is outdated, as a new one will always be generated in a compilation from rebuild all) Modified the structure of some folders, such as "protobuf" and "cmake" folder, "protobuf" was sent to the src main folder and "cmake" to the client main folder Namespace protobuf changed from "tibia" to "otclient" Merged the files of the Protobuf "shared.proto and appearances.proto" in one (appearances) Added: Issue Template Pull Request Template Pull Request Labeller Check to inform that clang is not supported (it is possible to use docker on mac, this way we avoid headaches related to support for an OS that is practically not used) GHA: Codacy CodeQL Review dog SonarCloud Build docker Build Ubuntu Build Windows Cmake: Cmakepresets VCPKG Manifest Otcicon Client: Added the functions LuaInterface::registerTable and LuaInterface::registerMethod and Bitwise Functions (if necessary at some point compatibility with the Lua 5.1) Note: Some checks are failing as they should only work after the merge, they should be ignored, the main ones are ok Thanks to @Costallat for for helping and assisting with addition of GHA and CMake build
1 parent df25bd5 commit 5531c40

File tree

93 files changed

+23265
-1907
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+23265
-1907
lines changed

.github/ISSUE_TEMPLATE/bug.yaml

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
name: Report a problem/bug
3+
description: Any issues that you have found while using the server
4+
labels: ["Type: Bug"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for taking the time to fill out this issue!
10+
- type: dropdown
11+
id: priority
12+
attributes:
13+
label: Priority
14+
description: How critical is this?
15+
options:
16+
- Low
17+
- Medium
18+
- High
19+
- Critical
20+
validations:
21+
required: true
22+
23+
- type: checkboxes
24+
id: area
25+
attributes:
26+
label: Area
27+
description: Where is the problem?
28+
options:
29+
- label: Data
30+
- label: Source
31+
- label: Docker
32+
- label: Other
33+
validations:
34+
required: true
35+
36+
- type: textarea
37+
id: what-happened
38+
attributes:
39+
label: What happened?
40+
description: Describe your problem/bug and add screenshots, logs or anything that can help verifying the bug
41+
placeholder: Tell us what you see!
42+
value: "A bug happened!"
43+
validations:
44+
required: true
45+
46+
- type: dropdown
47+
id: os
48+
attributes:
49+
label: What OS are you seeing the problem on?
50+
multiple: true
51+
options:
52+
- Linux
53+
- Windows
54+
- MacOS
55+
validations:
56+
required: true
57+
58+
- type: checkboxes
59+
id: terms
60+
attributes:
61+
label: Code of Conduct
62+
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/opentibiabr/canary/blob/main/CODE_OF_CONDUCT.md)
63+
options:
64+
- label: I agree to follow this project's Code of Conduct
65+
required: true

.github/ISSUE_TEMPLATE/bug_report.md

-30
This file was deleted.

.github/ISSUE_TEMPLATE/config.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
blank_issues_enabled: false
3+
contact_links:
4+
- name: 'Help / Support'
5+
url: 'https://discord.gg/abgQv8J4fF'
6+
about: If you have support question or need help, please use our Discord Server.

.github/ISSUE_TEMPLATE/request.yaml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
name: Request
3+
description: Any request
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for taking the time to fill out this issue!
9+
- type: dropdown
10+
id: priority
11+
attributes:
12+
label: Priority
13+
description: How critical is this?
14+
options:
15+
- Missing Content
16+
- Enhancement
17+
validations:
18+
required: true
19+
20+
- type: checkboxes
21+
id: area
22+
attributes:
23+
label: Area
24+
description: Where is the problem?
25+
options:
26+
- label: Data
27+
- label: Source
28+
- label: Docker
29+
- label: Other
30+
validations:
31+
required: true
32+
33+
- type: textarea
34+
id: missing-content
35+
attributes:
36+
label: What is missing?
37+
description: script, module, etc. Attach screenshots, logs, etc, anything that can helps us
38+
validations:
39+
required: true
40+
41+
- type: checkboxes
42+
id: terms
43+
attributes:
44+
label: Code of Conduct
45+
description: By submitting this issue, you agree to follow our [Code of Conduct]
46+
options:
47+
- label: I agree to follow this project's Code of Conduct
48+
required: true

.github/PULL_REQUEST_TEMPLATE.md

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
2+
# Description
3+
4+
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
5+
6+
## Behaviour
7+
### **Actual**
8+
9+
Do this and that doesn't happens
10+
11+
### **Expected**
12+
13+
Do this and that happens
14+
15+
## Fixes
16+
17+
\# (issue)
18+
19+
## Type of change
20+
21+
Please delete options that are not relevant.
22+
23+
- [ ] Bug fix (non-breaking change which fixes an issue)
24+
- [ ] New feature (non-breaking change which adds functionality)
25+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
26+
- [ ] This change requires a documentation update
27+
28+
## How Has This Been Tested
29+
30+
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
31+
32+
- [ ] Test A
33+
- [ ] Test B
34+
35+
**Test Configuration**:
36+
37+
- Server Version:
38+
- Client:
39+
- Operating System:
40+
41+
## Checklist
42+
43+
- [ ] My code follows the style guidelines of this project
44+
- [ ] I have performed a self-review of my own code
45+
- [ ] I checked the PR checks reports
46+
- [ ] I have commented my code, particularly in hard-to-understand areas
47+
- [ ] I have made corresponding changes to the documentation
48+
- [ ] My changes generate no new warnings
49+
- [ ] I have added tests that prove my fix is effective or that my feature works

.github/labeler.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"Area: Source":
3+
- any: ['src/**/*']
4+
5+
"Area: Datapack":
6+
- any: ['data/**/*']

.github/workflows/analysis-codacy.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: Analysis - Codacy Security Scan
3+
4+
on:
5+
pull_request:
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
codacy:
12+
name: Codacy Security Scan
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
18+
- name: Run Codacy Analysis CLI
19+
uses: codacy/codacy-analysis-cli-action@master
20+
with:
21+
output: results.sarif
22+
format: sarif
23+
gh-code-scanning-compat: true
24+
max-allowed-issues: 2147483647
25+
26+
- name: Upload SARIF results file
27+
uses: github/codeql-action/upload-sarif@main
28+
with:
29+
sarif_file: results.sarif

.github/workflows/analysis-codeql.yml

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
name: Analysis - CodeQL
3+
4+
on:
5+
push:
6+
paths:
7+
- 'src/**'
8+
- '**.py'
9+
10+
env:
11+
CMAKE_BUILD_PARALLEL_LEVEL: 2
12+
MAKEFLAGS: '-j 2'
13+
NODE_OPTIONS: ' --max-old-space-size=8192 '
14+
15+
jobs:
16+
codeql:
17+
name: CodeQL
18+
runs-on: ${{ matrix.os }}
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
os: [ubuntu-20.04]
24+
language: ['cpp', 'python']
25+
include:
26+
- language: cpp
27+
buildtype: linux-release
28+
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v3
32+
33+
- name: Initialize CodeQL
34+
uses: github/codeql-action/init@v2
35+
with:
36+
languages: ${{ matrix.language }}
37+
38+
- name: Install Linux Dependencies
39+
if: ${{ matrix.language == 'cpp' }}
40+
run: >
41+
sudo apt-get update && sudo apt-get install ccache libglew-dev libx11-dev linux-headers-$(uname -r)
42+
43+
- name: Switch to gcc-11
44+
if: ${{ matrix.language == 'cpp' }}
45+
run: |
46+
sudo apt install gcc-11 g++-11
47+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 --slave /usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11
48+
sudo update-alternatives --set gcc /usr/bin/gcc-11
49+
50+
- name: CCache
51+
uses: hendrikmuhs/[email protected]
52+
with:
53+
max-size: "1G"
54+
key: ccache-${{ matrix.os }}-${{ matrix.buildtype }}
55+
restore-keys: |
56+
ccache-${{ matrix.os }}
57+
58+
- name: Restore artifacts, or setup vcpkg (do not install any package)
59+
if: ${{ matrix.language == 'cpp' }}
60+
uses: lukka/run-vcpkg@v10
61+
with:
62+
vcpkgGitCommitId: 8d41d43e1f7f5933622b02e16430312da649361e
63+
64+
- name: Get latest CMake and ninja
65+
if: ${{ matrix.language == 'cpp' }}
66+
uses: lukka/get-cmake@latest
67+
68+
- name: Run CMake
69+
if: ${{ matrix.language == 'cpp' }}
70+
uses: lukka/run-cmake@v10
71+
with:
72+
configurePreset: ${{ matrix.buildtype }}
73+
buildPreset: ${{ matrix.buildtype }}
74+
75+
- name: Perform CodeQL Analysis
76+
uses: github/codeql-action/analyze@v2

0 commit comments

Comments
 (0)