-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
59 changed files
with
80,626 additions
and
8,450 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
name: Build Codegen | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
filter: | ||
runs-on: ubuntu-latest | ||
name: Filter | ||
outputs: | ||
should-run: ${{ steps.changed.outputs.any_changed }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Get changed files in the codegen folder | ||
id: changed | ||
uses: tj-actions/changed-files@v42 | ||
with: | ||
files: | | ||
.github/workflows/build.yml | ||
codegen/** | ||
build: | ||
needs: filter | ||
if: needs.filter.outputs.should-run == 'true' | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- name: Windows | ||
os: windows-latest | ||
id: win | ||
- name: macOS | ||
os: macos-latest | ||
id: mac | ||
- name: Linux | ||
os: ubuntu-latest | ||
id: linux | ||
|
||
name: Build ${{ matrix.config.name }} | ||
runs-on: ${{ matrix.config.os }} | ||
|
||
env: | ||
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm-cache | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Setup CPM Cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: cpm-cache | ||
key: cpm-${{ matrix.config.id }}-v1-${{ hashFiles('codegen/CMakeLists.txt') }} | ||
restore-keys: | | ||
cpm-${{ matrix.config.id }}-v1- | ||
- name: Install Ninja | ||
shell: bash | ||
run: | | ||
curl -L https://github.com/ninja-build/ninja/releases/latest/download/ninja-${{ matrix.config.id }}.zip -o ninja.zip | ||
7z x ninja.zip -o"$GITHUB_WORKSPACE/ninja" | ||
echo "$GITHUB_WORKSPACE/ninja" >> $GITHUB_PATH | ||
- name: Configure | ||
run: > | ||
cmake codegen -B codegen/build | ||
-DCMAKE_BUILD_TYPE=Release | ||
-DCMAKE_C_COMPILER=clang | ||
-DCMAKE_CXX_COMPILER=clang++ | ||
-G Ninja | ||
- name: Build | ||
run: cmake --build codegen/build --config Release --parallel | ||
|
||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: geode-codegen-${{ matrix.config.id }} | ||
path: | | ||
codegen/build/Codegen | ||
codegen/build/Codegen.exe | ||
if-no-files-found: ignore | ||
|
||
publish: | ||
name: Publish | ||
runs-on: ubuntu-latest | ||
needs: build | ||
if: github.ref == 'refs/heads/main' | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download Artifacts | ||
uses: actions/download-artifact@v4 | ||
|
||
- name: Move Binaries | ||
run: | | ||
mv geode-codegen-win/Codegen.exe geode-codegen-win.exe | ||
mv geode-codegen-mac/Codegen geode-codegen-mac-temp | ||
mv geode-codegen-linux/Codegen geode-codegen-linux-temp | ||
rmdir geode-codegen-mac | ||
rmdir geode-codegen-linux | ||
mv geode-codegen-mac-temp geode-codegen-mac | ||
mv geode-codegen-linux-temp geode-codegen-linux | ||
- name: Update Codegen Release | ||
uses: andelf/nightly-release@main | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: codegen | ||
name: 'Codegen Release' | ||
body: Geode codegen release for commit ${{ github.sha }}. | ||
files: | | ||
./geode-codegen-win.exe | ||
./geode-codegen-mac | ||
./geode-codegen-linux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
name: 'Verify bindings syntax' | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Restore cache | ||
id: codegen-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: bin | ||
key: codegen-${{ hashFiles('codegen/**') }} | ||
|
||
- name: Build Codegen binary | ||
if: steps.codegen-cache.outputs.cache-hit != 'true' | ||
run: | | ||
cmake ./codegen -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=./bin -B build | ||
cmake --build build --config RelWithDebInfo | ||
cmake --install build | ||
- name: Upload Codegen binary | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: Codegen | ||
path: bin/Codegen | ||
|
||
verify: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Download Codegen binary | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: Codegen | ||
|
||
- name: Verify | ||
run: 'chmod +x ./Codegen && ./Codegen Win32 bindings/2.200 out' | ||
|
||
test-members: | ||
# dont bother running member test if broma isnt even valid | ||
needs: verify | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- name: Windows | ||
os: windows-2022 | ||
prefixes: '' | ||
extra_flags: > | ||
-A win32 | ||
-D USE_HACKY_SCRIPT=ON | ||
- name: Android32 | ||
os: ubuntu-latest | ||
prefixes: '' | ||
extra_flags: > | ||
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake | ||
-DANDROID_ABI=armeabi-v7a | ||
-DANDROID_PLATFORM=android-23 | ||
-G Ninja | ||
-D USE_HACKY_SCRIPT=ON | ||
- name: Android64 | ||
os: ubuntu-latest | ||
prefixes: '' | ||
extra_flags: > | ||
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake | ||
-DANDROID_ABI=arm64-v8a | ||
-DANDROID_PLATFORM=android-23 | ||
-G Ninja | ||
-D USE_HACKY_SCRIPT=ON | ||
- name: macOS | ||
os_identifier: mac | ||
os: macos-latest | ||
extra_flags: > | ||
-DCMAKE_C_COMPILER=clang | ||
-DCMAKE_CXX_COMPILER=clang++ | ||
-DCMAKE_BUILD_TYPE=Debug | ||
name: Test Offsets ${{ matrix.config.name }} | ||
runs-on: ${{ matrix.config.os }} | ||
|
||
steps: | ||
- name: Checkout bindings | ||
uses: actions/checkout@v4 | ||
|
||
- name: Checkout geode | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: geode-sdk/geode | ||
path: geode | ||
|
||
- name: Set up codegen binary cache | ||
id: codegen-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: build/bindings/codegen | ||
# cache by os since for android32 and 64 the codegen binary is the same | ||
key: codegen-${{ hashFiles('codegen/**') }}-${{ matrix.config.os }} | ||
|
||
- name: Set up android env | ||
run: | | ||
sudo apt install ninja-build | ||
if: matrix.config.os == 'ubuntu-latest' | ||
|
||
- name: Set GEODE_SDK | ||
shell: bash | ||
run: echo "GEODE_SDK=${{ github.workspace }}/geode" >> $GITHUB_ENV | ||
|
||
- name: Configure CMake | ||
shell: bash | ||
run: > | ||
cmake -B build -S test/members | ||
-D SKIP_BUILDING_CODEGEN=${{ steps.codegen-cache.outputs.cache-hit }} | ||
${{ matrix.config.extra_flags }} | ||
# SKIP_BUILDING_CODEGEN will skip building codegen if finds a cached binary, | ||
# locally you dont need to set it | ||
# USE_HACKY_SCRIPT will use the python script and some hackery to print the | ||
# offsets in a nicer way. it is also not required | ||
|
||
- name: Build member test | ||
run: | | ||
cmake --build build --config RelWithDebInfo --parallel --target TestMembers | ||
- name: Show Errors | ||
run: python test/members/check.py build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
build/ | ||
.vscode/ | ||
__scripts | ||
**/.DS_Store | ||
scripts/Bindings.json | ||
__optcall.xml | ||
__membercall.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.