Skip to content

Commit

Permalink
Merge pull request #2 from GsLogiMaker/feature/mac-x86-64-build
Browse files Browse the repository at this point in the history
Add mac x86_64 build to unittests.yml
  • Loading branch information
GsLogiMaker authored May 20, 2024
2 parents 3c36399 + 158e398 commit c1be0a2
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 27 deletions.
45 changes: 29 additions & 16 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

name: Run Unit Tests
name: Build Process

on:
push:
Expand All @@ -14,19 +14,26 @@ jobs:
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
# Linux
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
glecs_lib: libglecs.so
- os: ubuntu-latest
target: i686-unknown-linux-gnu
- target: i686-unknown-linux-gnu
os: ubuntu-latest
glecs_lib: libglecs.so
- os: ubuntu-latest
target: x86_64-pc-windows-gnu
# Mac
- target: x86_64-apple-darwin
os: macos-latest
glecs_lib: libglecs.rlib
# Windows
- target: x86_64-pc-windows-gnu
os: ubuntu-latest
glecs_lib: glecs.dll
runs-on: ${{ matrix.os }}
outputs:
x86_64-linux_lib_cache_key: ${{ steps.set_cache_key.outputs.x86_64-unknown-linux-gnu_lib_cache_key }}
i686-linux_lib_cache_key: ${{ steps.set_cache_key.outputs.i686-unknown-linux-gnu_lib_cache_key }}
x86_64-mac_lib_cache_key: ${{ steps.set_cache_key.outputs.x86_64-apple-darwin_lib_cache_key }}
x86_64-windows_lib_cache_key: ${{ steps.set_cache_key.outputs.x86_64-pc-windows-gnu_lib_cache_key }}
steps:
- name: 🐙 Settup git environment
Expand All @@ -47,11 +54,11 @@ jobs:
rustup target add ${{ matrix.target }}
- name: 🐧 Install GCC multilib for Linux i686 build
if: ${{ matrix.target }} == i686-unknown-linux-gnu
if: ${{ matrix.target == 'i686-unknown-linux-gnu' && runner.os == 'Linux'}}
run: sudo apt-get install gcc-multilib

- name: 🪟 Install mingw for Windows build
if: ${{ matrix.target }} == x86_64-pc-windows-gnu
if: ${{ matrix.target == 'x86_64-pc-windows-gnu' && runner.os == 'Linux' }}
run: sudo apt install gcc-mingw-w64

- name: 🦀 Build Rust code
Expand Down Expand Up @@ -82,7 +89,7 @@ jobs:
enableCrossOsArchive: true


test_suite:
run_test_suite:
needs: compile_glecs
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -130,14 +137,10 @@ jobs:


update_nightly:
needs: ["compile_glecs", "test_suite"]
if: ${{ github.action == 'push' }}
needs: ["compile_glecs", "run_test_suite"]
runs-on: windows-latest
steps:
- name: 📍 Exit early if action is not "push"
if: ${{ github.action }} != "push"
run: |
exit 0
- name: 🐙 Settup git environment
uses: actions/checkout@v4
with:
Expand All @@ -164,6 +167,16 @@ jobs:
# An optional boolean when enabled, allows windows runners to save or restore caches that can be restored or saved respectively on other platforms
enableCrossOsArchive: true

- name: 🍎 Load compiled library, Mac x86_64
uses: actions/cache/[email protected]
with:
# A list of files, directories, and wildcard patterns to cache and restore
path: ./addons/glecs/bin/x86_64-apple-darwin/release/libglecs.rlib
# An explicit key for restoring and saving the cache
key: ${{ needs.compile_glecs.outputs.x86_64-mac_lib_cache_key }}
# An optional boolean when enabled, allows windows runners to save or restore caches that can be restored or saved respectively on other platforms
enableCrossOsArchive: true

- name: 🪟 Load compiled library, Windows x86_64
uses: actions/cache/[email protected]
with:
Expand Down
14 changes: 7 additions & 7 deletions addons/glecs/glecs.gdextension
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ reloadable = true

[libraries]

windows.release.x86_64 = "./bin/release/glecs.dll"
windows.debug.x86_64 = "./bin/debug/glecs.dll"

linux.release.x86_64 = "./bin/release/libglecs.so"
linux.debug.x86_64 = "./bin/debug/libglecs.so"

macos.release.x86_64 = "./bin/release/libglecs.dylib"
macos.debug.x86_64 = "./bin/debug/libglecs.dylib"
macos.release.arm64 = "./bin/release/libglecs.dylib"
macos.debug.arm64 = "./bin/debug/libglecs.dylib"
windows.release.x86_64 = "./bin/release/glecs.dll"
windows.debug.x86_64 = "./bin/debug/glecs.dll"

macos.release.x86_64 = "./bin/release/libglecs.rlib"
macos.debug.x86_64 = "./bin/debug/libglecs.rlib"
macos.release.arm64 = "./bin/release/libglecs.rlib"
macos.debug.arm64 = "./bin/debug/libglecs.rlib"
8 changes: 4 additions & 4 deletions addons/glecs/glecs.gdextension.release
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ linux.debug.x86_64 = "./bin/x86_64-unknown-linux-gnu/release/libglecs.so"
windows.release.x86_64 = "./bin/x86_64-pc-windows-gnu/release/glecs.dll"
windows.debug.x86_64 = "./bin/x86_64-pc-windows-gnu/release/glecs.dll"

macos.release.x86_64 = "./bin/x86_64-apple-darwin/release/libglecs.dylib"
macos.debug.x86_64 = "./bin/x86_64-apple-darwin/release/libglecs.dylib"
macos.release.arm64 = "./bin/x86_64-apple-darwin/release/libglecs.dylib"
macos.debug.arm64 = "./bin/x86_64-apple-darwin/release/libglecs.dylib"
macos.release.x86_64 = "./bin/x86_64-apple-darwin/release/libglecs.rlib"
macos.debug.x86_64 = "./bin/x86_64-apple-darwin/release/libglecs.rlib"
macos.release.arm64 = "./bin/x86_64-apple-darwin/release/libglecs.rlib"
macos.debug.arm64 = "./bin/x86_64-apple-darwin/release/libglecs.rlib"

0 comments on commit c1be0a2

Please sign in to comment.