Skip to content

Commit d022f0c

Browse files
authored
Merge pull request #1 from libxengine/actions
Actions
2 parents 2874b10 + f0ac220 commit d022f0c

File tree

15 files changed

+420
-14
lines changed

15 files changed

+420
-14
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Browser [e.g. chrome, safari]
29+
- Version [e.g. 22]
30+
31+
**Smartphone (please complete the following information):**
32+
- Device: [e.g. iPhone6]
33+
- OS: [e.g. iOS8.1]
34+
- Browser [e.g. stock browser, safari]
35+
- Version [e.g. 22]
36+
37+
**Additional context**
38+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/workflows/codeql.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: CodeQL Advanced
2+
3+
on:
4+
push:
5+
branches:
6+
- 'develop'
7+
paths:
8+
- 'XEngine_Source/**'
9+
- 'XEngine_Release/**'
10+
- '.github/**'
11+
12+
jobs:
13+
analyze:
14+
runs-on: ubuntu-24.04
15+
permissions:
16+
security-events: write
17+
packages: read
18+
actions: read
19+
contents: read
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
include:
25+
- language: c-cpp
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
with:
30+
ref: 'develop'
31+
32+
- name: Checkout dependency repository (xengine)
33+
uses: actions/checkout@v4
34+
with:
35+
repository: libxengine/libxengine
36+
path: libxengine
37+
38+
- name: sub module checkout (opensource)
39+
run: |
40+
git submodule init
41+
git submodule update
42+
43+
- name: Set up Dependency Environment
44+
run: |
45+
cd libxengine
46+
chmod +x ./XEngine_LINEnv.sh
47+
sudo ./XEngine_LINEnv.sh -i 3
48+
49+
- name: Initialize CodeQL
50+
uses: github/codeql-action/init@v3
51+
with:
52+
languages: ${{ matrix.language }}
53+
54+
- name: make
55+
run: |
56+
cd XEngine_Source
57+
make
58+
59+
- name: Perform CodeQL Analysis
60+
uses: github/codeql-action/analyze@v3
61+
with:
62+
category: "/language:${{ matrix.language }}"

.github/workflows/cppcheck.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: cpp check workflows
2+
3+
on:
4+
push:
5+
branches:
6+
- 'develop'
7+
paths:
8+
- 'XEngine_Source/**'
9+
- 'XEngine_Release/**'
10+
- '.github/**'
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout main repository code
18+
uses: actions/checkout@v4
19+
with:
20+
ref: 'develop'
21+
22+
- name: Create static_analysis directory
23+
run: mkdir -p static_analysis
24+
25+
- name: Run Cppcheck
26+
run: |
27+
sudo apt-get install -y cppcheck
28+
cppcheck --enable=all --language=c++ --std=c++20 ./XEngine_Source/ --output-file=static_analysis/log.xml --xml
29+
continue-on-error: true
30+
31+
- name: Upload Cppcheck Results
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: cppcheck_results
35+
path: static_analysis/log.xml
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Issue Translator
2+
on:
3+
issue_comment:
4+
types: [created]
5+
issues:
6+
types: [opened]
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: usthe/[email protected]
13+
with:
14+
IS_MODIFY_TITLE: true
15+
CUSTOM_BOT_NOTE: Bot detected the issue body's language is not English, translate it automatically.

.github/workflows/macbuild.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: macos build workflows
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
- 'actions'
8+
9+
jobs:
10+
build:
11+
strategy:
12+
matrix:
13+
include:
14+
- os: macos-13
15+
- os: macos-14
16+
runs-on: ${{ matrix.os }}
17+
18+
steps:
19+
- name: Checkout main repository code
20+
uses: actions/checkout@v4
21+
22+
# 检出依赖的xengine仓库到指定的xengine目录
23+
- name: Checkout dependency repository (xengine)
24+
uses: actions/checkout@v4
25+
with:
26+
repository: libxengine/libxengine
27+
path: libxengine
28+
29+
- name: brew install
30+
run: |
31+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
32+
brew install sdl2
33+
34+
- name: Set up Dependency x86_64 Environment
35+
if: matrix.os == 'macos-13'
36+
run: |
37+
cd libxengine
38+
chmod 777 *
39+
./XEngine_LINEnv.sh -i 3
40+
- name: Set up Dependency Arm64 Environment
41+
if: matrix.os == 'macos-14'
42+
run: |
43+
cd libxengine
44+
chmod 777 *
45+
./XEngine_LINEnv.sh -i 0
46+
47+
latest_tag=$(git ls-remote --tags --sort="v:refname" https://github.com/libxengine/libxengine.git | awk '{print $2}' | sed 's/refs\/tags\///' | tail -n 1)
48+
49+
wget https://github.com/libxengine/libxengine/releases/download/$latest_tag/XEngine_Mac_Arm64.zip
50+
unzip ./XEngine_Mac_Arm64.zip -d ./XEngine_Mac_Arm64
51+
cd XEngine_Mac_Arm64
52+
53+
sudo mkdir -p /usr/local/include
54+
sudo mkdir -p /usr/local/lib
55+
sudo cp -rf ./XEngine_Include /usr/local/include
56+
sudo find ./XEngine_Mac -name "*.dylib" -exec cp {} /usr/local/lib \;
57+
58+
- name: make
59+
run: |
60+
cd XEngine_Module
61+
cd jsoncpp
62+
make PLATFORM=mac
63+
cd ..
64+
cd tinyxml2
65+
make PLATFORM=mac
66+
cd ..
67+
cd XEngine_InfoReport
68+
make PLATFORM=mac
69+
cd ..
70+
cd XEngine_AVPlayer
71+
make PLATFORM=mac

.github/workflows/msbuild.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: windows build workflows
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
- 'actions'
8+
9+
jobs:
10+
build:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
configuration: [Debug ,Release]
15+
platform: [x86 ,x64]
16+
17+
runs-on: windows-latest # 最新的 Windows 环境
18+
19+
steps:
20+
# 检出您的主仓库代码
21+
- name: Checkout main repository code
22+
uses: actions/checkout@v4
23+
24+
# 检出依赖的xengine仓库到指定的xengine目录
25+
- name: Checkout dependency repository (xengine)
26+
uses: actions/checkout@v4
27+
with:
28+
repository: libxengine/libxengine
29+
path: libxengine
30+
31+
- name: vcpkg dependency repository
32+
uses: actions/checkout@v4
33+
with:
34+
repository: microsoft/vcpkg
35+
path: vcpkg
36+
37+
- name: vcpkg install (x86)
38+
if: matrix.platform == 'x86'
39+
run: |
40+
cd vcpkg
41+
./bootstrap-vcpkg.bat
42+
./vcpkg.exe install sdl2:x86-windows
43+
./vcpkg.exe integrate install
44+
shell: pwsh
45+
- name: vcpkg install (x64)
46+
if: matrix.platform == 'x64'
47+
run: |
48+
cd vcpkg
49+
./bootstrap-vcpkg.bat
50+
./vcpkg.exe install sdl2:x64-windows
51+
./vcpkg.exe integrate install
52+
shell: pwsh
53+
54+
- name: Set up Dependency x86_64 Environment
55+
if: matrix.platform == 'x64'
56+
run: |
57+
echo "XENGINE_INCLUDE=${{ github.workspace }}/libxengine" | Out-File -FilePath $env:GITHUB_ENV -Append
58+
echo "XENGINE_LIB64=${{ github.workspace }}/libxengine/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append
59+
shell: pwsh
60+
- name: Set up Dependency x86_32 Environment
61+
if: matrix.platform == 'x86'
62+
run: |
63+
$response = Invoke-RestMethod -Uri "https://api.github.com/repos/libxengine/libxengine/releases/latest" -Headers @{"Accept"="application/vnd.github.v3+json"}
64+
$latest_tag = $response.tag_name
65+
Write-Host "Latest Tag: $latest_tag"
66+
67+
$url = "https://github.com/libxengine/libxengine/releases/download/$latest_tag/XEngine_Windows_x86-32.zip"
68+
Invoke-WebRequest -Uri $url -OutFile "XEngine_Windows_x86-32.zip"
69+
Expand-Archive -Path ./XEngine_Windows_x86-32.zip -DestinationPath ./XEngine_Windows -Force
70+
71+
echo "XENGINE_INCLUDE=${{ github.workspace }}/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append
72+
echo "XENGINE_LIB32=${{ github.workspace }}/XEngine_Windows/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append
73+
shell: pwsh
74+
75+
- name: Setup MSBuild
76+
uses: microsoft/setup-msbuild@v2
77+
78+
- name: Build Solution
79+
run: msbuild XEngine.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }}

0 commit comments

Comments
 (0)