Skip to content

Commit

Permalink
Merge branch 'xml_converter' into updated_xml_converter
Browse files Browse the repository at this point in the history
  • Loading branch information
klingbolt authored Sep 23, 2024
2 parents 12fb1e1 + 4637b96 commit 73d67f6
Show file tree
Hide file tree
Showing 357 changed files with 24,564 additions and 546 deletions.
92 changes: 92 additions & 0 deletions .github/workflows/diff_protobin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Diff Protobin

on:
pull_request_target:
paths:
- '**/*.bin'
jobs:
custom-diff:
runs-on: ubuntu-latest
if: '!github.event.pull_request.draft'
permissions: write-all
steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Install ProtoC
run: sudo apt-get install -y protobuf-compiler

- name: Fetch PR commits
run: |
git fetch origin +refs/pull/${{ github.event.pull_request.number }}/head:refs/pull/${{ github.event.pull_request.number }}/head
git fetch origin ${{ github.base_ref }}
- name: Get Filenames
run: |
for file in $(git diff --name-only origin/${{ github.base_ref }} refs/pull/${{ github.event.pull_request.number }}/head | grep '.bin$'); do
mkdir -p $(dirname "$file")
if [ -n "$(git ls-tree "origin/${{ github.base_ref }}" -- "$file")" ]; then
git show origin/${{ github.base_ref }}:$file > $file._old
protoc --decode=guildpoint.Guildpoint xml_converter/proto/guildpoint.proto < $file._old > $file.textproto._old
else
touch $file.textproto._old
fi
if [ -n "$(git ls-tree "refs/pull/${{ github.event.pull_request.number }}/head" -- "$file")" ]; then
git show refs/pull/${{ github.event.pull_request.number }}/head:$file > $file._new
protoc --decode=guildpoint.Guildpoint xml_converter/proto/guildpoint.proto < $file._new > $file.textproto._new
else
touch $file.textproto._new
fi
diff -u $file.textproto._old $file.textproto._new > $file._diff || true
echo $file >> file_list.txt
done
- name: Get PR commit hash
id: prcommithash
run: |
PR_COMMIT_HASH=$(git log --format="%H" -n 1 refs/pull/${{ github.event.pull_request.number }}/head)
echo "Latest PR Commit Hash: $PR_COMMIT_HASH"
echo "pr_commit_hash="$PR_COMMIT_HASH >> $GITHUB_OUTPUT
- name: Post Comment
if: always()
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const path = require('path');
const issue_number = context.issue.number;
const githubToken = process.env.GITHUB_TOKEN;
const files = fs.readFileSync('file_list.txt', 'utf8').split("\n");
for (let file of files) {
if (file == "") {
continue;
}
const diff_contents = fs.readFileSync(file + "._diff", 'utf8')
let comment_body = [
"<details>",
"<summary>Full Diff</summary>",
"",
"```diff",
diff_contents,
"```",
"</details>",
].join("\n");
console.log(file)
await github.rest.pulls.createReviewComment({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: issue_number,
path: file,
body: comment_body,
commit_id: '${{ steps.prcommithash.outputs.pr_commit_hash }}',
subject_type: "file",
});
}
230 changes: 186 additions & 44 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This workflow will compile the burrio_link and export the burrito binary
# the two files will be available as an artifact.
# This workflow will compile burrio_link.exe, the burrito binary, and any
# additional libraries needed to run. All these files will then be available
# as an artifact.

name: CI

Expand All @@ -25,16 +26,133 @@ on:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
Build-Linux:
Build-XMLConverter-Linux:
# The type of runner that the job will run on
runs-on: ubuntu-20.04

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v4

# - name: Update Packages
# run: sudo apt-get update && sudo apt-get upgrade
# IWYU is disabled for now due to noise. It will be re-enabled at a later date
# # `clang-9` must be installed here because of a weird unlisted dependency
# # on some sort of file that clang-9 installs. Without it iwyu would
# # complain about missing files and error out.
# - name: Install include-what-you-use
# run: |
# sudo apt-get install iwyu
# sudo apt-get install clang-9

- name: Install protoc
run: sudo apt-get install protobuf-compiler

- name: Install gtest
run: sudo apt-get install libgtest-dev

- name: Install cpplint
run: |
pip3 install cpplint
- name: Install xml_converter python Dependencies
run: |
cd xml_converter
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
- name: Build xml_converter
run: |
cd xml_converter
mkdir -v -p build
cd build
cmake ..
make
- name: Validate xml_converter
run: |
cd xml_converter
cp build/compile_commands.json ./compile_commands.json
./presubmit.sh
- name: Upload created file
uses: actions/upload-artifact@v3
with:
name: xml_converter
path: xml_converter/build/xml_converter
if-no-files-found: error

Build-BurritoLink-Linux:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install mingw
run: sudo apt-get install gcc-mingw-w64

- name: Build Burrito Link
run: |
mkdir burrito_link/build
cd burrito_link/build
cmake ..
make
- name: Upload Standalone Executable Burrito Link
uses: actions/upload-artifact@v3
with:
name: burrito_link_exe
path: burrito_link/build/burrito_link.exe
if-no-files-found: error

- name: Upload Shared Library Burrito Link
uses: actions/upload-artifact@v3
with:
name: burrito_link_dll
path: burrito_link/build/d3d11.dll
if-no-files-found: error

Build-BurritoFG-Linux:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Build X11_FG
run: |
cd burrito-fg
cargo build --release
- name: Upload created file
uses: actions/upload-artifact@v3
with:
name: BurritoFG
path: burrito-fg/target/release/libburrito_fg.so
if-no-files-found: error

Build-TacoParser-Linux:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Build taco_parser
run: |
cd taco_parser
cargo build --release
- name: Upload created file
uses: actions/upload-artifact@v3
with:
name: TacoParser
path: taco_parser/target/release/libgw2_taco_parser.so
if-no-files-found: error

Build-BurritoUI-Linux:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v4

# - name: Cache Godot
# id: cache-godot
Expand All @@ -43,14 +161,15 @@ jobs:
# path: ./Godot_v${GODOT_VERSION}-stable_linux_headless.64
# key: ${{ runner.os }}-godot-${GODOT_VERSION}-${CACHE_STRING}

#

- name: Download Godot
# if: steps.cache-godot.outputs.cache-hit != 'true'
run: |
wget -q https://downloads.tuxfamily.org/godotengine/${GODOT_VERSION}/Godot_v${GODOT_VERSION}-stable_linux_headless.64.zip
wget -q https://github.com/godotengine/godot/releases/download/${GODOT_VERSION}-stable/Godot_v${GODOT_VERSION}-stable_linux_headless.64.zip
unzip Godot_v${GODOT_VERSION}-stable_linux_headless.64.zip
rm Godot_v${GODOT_VERSION}-stable_linux_headless.64.zip
# - name: Cache Godot Templates
# id: cache-godot-templates
# uses: actions/cache@v2
Expand All @@ -64,59 +183,82 @@ jobs:
run: |
mkdir -v -p ~/.local/share/godot/templates/${GODOT_VERSION}.stable/
wget -q https://downloads.tuxfamily.org/godotengine/${GODOT_VERSION}/Godot_v${GODOT_VERSION}-stable_export_templates.tpz
wget -q https://github.com/godotengine/godot/releases/download/${GODOT_VERSION}-stable/Godot_v${GODOT_VERSION}-stable_export_templates.tpz
unzip Godot_v${GODOT_VERSION}-stable_export_templates.tpz
mv templates/* ~/.local/share/godot/templates/${GODOT_VERSION}.stable/
ls ~/.local/share/godot/templates/${GODOT_VERSION}.stable/
- name: Fake The GDNative Files
run: |
mkdir -p burrito-fg/target/release/
touch burrito-fg/target/release/libburrito_fg.so
mkdir -p taco_parser/target/release/
touch taco_parser/target/release/libgw2_taco_parser.so
- name: Install mingw
run: sudo apt-get install gcc-mingw-w64
- name: Build Burrito
run: |
mkdir -v -p build
./Godot_v${GODOT_VERSION}-stable_linux_headless.64 --export "Linux/X11"
chmod +x build/burrito.x86_64
- uses: actions/upload-artifact@v3
with:
name: Burrito_UI
path: build/burrito.x86_64
if-no-files-found: error

# Runs a single command using the runners shell
- name: Create the Output Directory
run: mkdir output

- name: Build X11_FG
run: |
cd burrito-fg
cargo build --release
Package-Burrito-Linux:
runs-on: ubuntu-20.04
needs:
- Build-XMLConverter-Linux
- Build-BurritoLink-Linux
- Build-BurritoUI-Linux
- Build-BurritoFG-Linux
- Build-TacoParser-Linux
steps:
- name: Download Burrito UI
uses: actions/download-artifact@v3
with:
name: Burrito_UI

- name: Build taco_parser
run: |
cd taco_parser
cargo build --release
- name: Download Burrito FG
uses: actions/download-artifact@v3
with:
name: BurritoFG

- name: Build Burrito Link
run: |
mkdir output/burrito_link
mkdir burrito_link/build
cd burrito_link/build
cmake ..
make
mv burrito_link.exe ../../output/burrito_link
mv d3d11.dll ../../output/burrito_link
- name: Download TacoParser
uses: actions/download-artifact@v3
with:
name: TacoParser

- name: Download XML Converter
uses: actions/download-artifact@v3
with:
name: xml_converter

- name: Download Burrito Link Exe
uses: actions/download-artifact@v3
with:
name: burrito_link_exe

- name: Download Burrito Link DLL
uses: actions/download-artifact@v3
with:
name: burrito_link_dll

- name: Build Burrito
run: |
mkdir build
./Godot_v${GODOT_VERSION}-stable_linux_headless.64 --export "Linux/X11"
chmod +x build/burrito.x86_64
mv build/burrito.x86_64 output/
mv build/libburrito_fg.so output/
mv build/libgw2_taco_parser.so output/

- name: Move Burrito Link
run: |
mkdir burrito_link/
mv burrito_link.exe burrito_link/
mv d3d11.dll burrito_link/
- uses: actions/upload-artifact@v2.2.4
- uses: actions/upload-artifact@v3
with:
# Artifact name
name: "Burrito_Linux" # optional, default is artifact
# A file, directory or wildcard pattern that describes what to upload
path: "output/*"
path: "./*"
# The desired behavior if no files are found using the provided path.
if-no-files-found: error
# Duration after which artifact will expire in days. 0 means using default retention.
retention-days: 0
18 changes: 18 additions & 0 deletions Category2D.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
extends Node2D

var trails2d: Array = []
var subcategories: Array = []

func add_trail2d(trail2d):
self.add_child(trail2d, true)
trails2d.push_back(trail2d)

func add_subcategory(subcategory):
self.add_child(subcategory, true)
subcategories.push_back(subcategory)

func clear_all():
self.trails2d = []
self.subcategories = []
for child in self.get_children():
child.queue_free()
Loading

0 comments on commit 73d67f6

Please sign in to comment.