Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Mac CI build job to handle the new targets #5

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
c81b49b
Update macOS build job with more steps
DeBlister May 29, 2022
5c18231
Correct spacing for YAML syntax
DeBlister May 29, 2022
f5aa3d2
Correct Spacing for YAML syntax 2
DeBlister May 29, 2022
06c9507
Fetch SDL2 if hash has changed
DeBlister May 29, 2022
10ed4f3
Revert "Fetch SDL2 if hash has changed"
DeBlister May 29, 2022
99c278f
Correct engine target dependencies
DeBlister May 29, 2022
764749e
Trim logic
DeBlister May 29, 2022
5512abb
Complete engine path for mv
DeBlister May 29, 2022
f5bcb9a
Add parentheses for YAML syntax
DeBlister May 29, 2022
0319f0b
Merge branch 'Xcode_CompileUnitTests' into Xcode_CompileUnitTests_Upd…
DeBlister May 29, 2022
ac7409c
Save the entire engine framework
DeBlister May 29, 2022
0c42703
Rename macos build artifacts and correct uploads
DeBlister May 29, 2022
ba9babe
Merge branch 'Xcode_CompileUnitTests' into Xcode_CompileUnitTests_Upd…
DeBlister May 29, 2022
9755807
Merge branch 'Xcode_CompileUnitTests' into Xcode_CompileUnitTests_Upd…
DeBlister May 29, 2022
6ee03a6
Only upload the engine executable (again)
DeBlister May 29, 2022
340f324
Update macOS test parse 1
DeBlister May 29, 2022
cd24b50
Adjust env var in build_macos
DeBlister May 29, 2022
3b80ef2
Remove guard for testing macos-parse MUST REVERT BEFORE MERGING
DeBlister May 29, 2022
c20811b
Adjust env var in test_macos-parse
DeBlister May 29, 2022
c940408
Fix mkdir path in test_macos-parse
DeBlister May 29, 2022
d97139e
Adjust mkdir path in test_macos-parse
DeBlister May 29, 2022
d8f1707
Test for which command is throwing the error
DeBlister May 29, 2022
6a56fc2
Use A version instead of Current version
DeBlister May 29, 2022
79b4b9b
Revert "Test for which command is throwing the error"
DeBlister May 29, 2022
7c59a88
Place engine binary where its symlink usually is
DeBlister May 30, 2022
d43fef9
Place engine binary back and create symlink
DeBlister May 30, 2022
e7098b6
Correct symlink pathing
DeBlister May 30, 2022
bda4aa0
Add the Current version symlink
DeBlister May 30, 2022
12baa3e
Use correct linking syntax for framework symlinks
DeBlister May 30, 2022
e5648b5
Correct Current version symlink relative path
DeBlister May 30, 2022
e4175d2
Correct working directory before verifying executable
DeBlister May 30, 2022
eb2e7e3
Add rpath tests MUST REVERT BEFORE MERGING
DeBlister May 30, 2022
7be05a2
Revert "Add rpath tests MUST REVERT BEFORE MERGING"
DeBlister May 30, 2022
a03918e
Use consistent variable referencing style
DeBlister May 30, 2022
443df28
Get some information about file structure
DeBlister May 30, 2022
ca36721
Also copy SDL2 to top-level Frameworks
DeBlister May 30, 2022
08d7d44
Use cp directory copy syntax
DeBlister May 30, 2022
d0a7545
Fix engine artifact download path
DeBlister May 30, 2022
a8b4b4f
Fix mkdir engine framework subfolders path
DeBlister May 30, 2022
90ed107
Get more information about file structure
DeBlister May 30, 2022
bc09209
Typo fix from previous commit
DeBlister May 30, 2022
225e1d6
Get more information right after mkdir
DeBlister May 30, 2022
4704e25
Revert "Get more information right after mkdir"
DeBlister May 30, 2022
286439b
Add more checkpoints and use tree instead of ls
DeBlister May 30, 2022
c9c693c
Step deeper and re-add top level check
DeBlister May 30, 2022
1835b28
Switch variable syntax for engine download
DeBlister May 30, 2022
7c526e2
Fix typo in step name
DeBlister May 30, 2022
3058432
Switch variable reference style
DeBlister May 30, 2022
e9c755a
Remove SDL2 from top level Frameworks
DeBlister May 30, 2022
fc3fa88
Remove unnecessary quotes
DeBlister May 30, 2022
ded5c89
Add SDL2 symlink instead of copying it
DeBlister May 30, 2022
b5dfb87
Improve final tree view
DeBlister May 30, 2022
566c3bc
Fix missing quotes
DeBlister May 30, 2022
e265e2d
Remove symlink again and hope it works this time
DeBlister May 30, 2022
c8a5c92
Add some loader paths pointing inside ES_Engine
DeBlister May 30, 2022
7fe2b4c
Do the same for unit test target
DeBlister May 30, 2022
9392a91
Use A version instead of Current version
DeBlister May 30, 2022
0d0e042
Don't add Current version symlink
DeBlister May 30, 2022
2ce1cf5
Remove ES_Engine exectuable symlink
DeBlister May 30, 2022
c0f9ad4
Remove tree install and usages
DeBlister May 30, 2022
3792241
Add test_macos-unit
DeBlister May 30, 2022
ab6d093
Run executable without quotes
DeBlister May 30, 2022
6a99a0d
Fix matrix-os indentation
DeBlister May 30, 2022
c723ee0
Toggle active if-guards
DeBlister May 30, 2022
0a91969
Verify and give execute permissions to executable
DeBlister May 30, 2022
cdd9c0a
Change step name and avoid using incompatible option
DeBlister May 30, 2022
94b1374
Run both macos tests without extra cd step
DeBlister May 31, 2022
3c09aba
Change macos environment variables convention
DeBlister May 31, 2022
f334493
Restore guards to macos tests
DeBlister Jun 1, 2022
b53dd72
Account for macos changes
DeBlister Jun 1, 2022
c194f0b
Replace some hard coding with existing variables
DeBlister Jun 1, 2022
010b71f
Test without quotes on paths
DeBlister Jun 1, 2022
36c5706
Try without quotes on build targets
DeBlister Jun 1, 2022
e95a60f
Try without quotes on build configuration
DeBlister Jun 1, 2022
a5fc5b6
Revert "Test without quotes on paths"
DeBlister Jun 1, 2022
14e1556
Revert "Try without quotes on build target"
DeBlister Jun 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/path-filters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ game_code: &build
macos:
- 'XCode/**'
- '**/*.xcodeproj'
- '**/*.xcworkspace'
- '**/xcshareddata/*'
- 'icons/endless-sky.iconset/**'
- 'utils/fetch_sdl2_framework.sh'
- 'utils/set_dylibs_rpath.sh'
Expand Down
135 changes: 115 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -281,39 +281,127 @@ jobs:
matrix:
os: [macos-latest]
env:
ARTIFACT: Endless Sky
ENGINE: ES_Engine
GAME_ARTIFACT: Endless Sky
UNITTEST_ARTIFACT: ES_UnitTests
SDL2_FRAMEWORK: build/SDL2.framework
steps:
- uses: actions/checkout@v2
- name: Restore cached engine framework
id: cache-engine
uses: actions/cache@v2
with:
path: ${{ env.ENGINE }}
key: ${{ matrix.os }}-artifacts-${{ hashFiles('source/**', '.github/workflows/ci.yml', 'EndlessSky.xcodeproj/**', 'utils/set_dylibs_rpath.sh', 'utils/fetch_sdl2_framework.sh') }}
- name: Restore cached game binary
id: cache-artifact
id: cache-game_artifact
uses: actions/cache@v2
with:
path: ${{ env.ARTIFACT }}
path: ${{ env.GAME_ARTIFACT }}
key: ${{ matrix.os }}-artifacts-${{ hashFiles('source/**', '.github/workflows/ci.yml', 'EndlessSky.xcodeproj/**', 'utils/set_dylibs_rpath.sh', 'utils/fetch_sdl2_framework.sh') }}
- name: Restore cached unit tests binary
id: cache-unittest_artifact
uses: actions/cache@v2
with:
path: ${{ env.UNITTEST_ARTIFACT }}
key: ${{ matrix.os }}-artifacts-${{ hashFiles('source/**', '.github/workflows/ci.yml', 'EndlessSky.xcodeproj/**', 'utils/set_dylibs_rpath.sh', 'utils/fetch_sdl2_framework.sh') }}
- name: Update Homebrew
if: steps.cache-artifact.outputs.cache-hit != 'true'
if: (!(steps.cache-engine.outputs.cache-hit && steps.cache-game_artifact.outputs.cache-hit && steps.cache.unittest_artifact.outputs.cache-hit))
run: brew update
- name: Install dependencies
if: steps.cache-artifact.outputs.cache-hit != 'true'
if: (!(steps.cache-engine.outputs.cache-hit && steps.cache-game_artifact.outputs.cache-hit && steps.cache.unittest_artifact.outputs.cache-hit))
run: brew install libmad libpng jpeg-turbo
- name: Restore cached SDL2 framework
if: steps.cache-artifact.outputs.cache-hit != 'true'
if: (!(steps.cache-engine.outputs.cache-hit && steps.cache-game_artifact.outputs.cache-hit && steps.cache.unittest_artifact.outputs.cache-hit))
uses: actions/cache@v2
with:
path: ${{ env.SDL2_FRAMEWORK }}
key: ${{ matrix.os }}-sdl2-${{ hashFiles('.github/workflows/ci.yml', 'EndlessSky.xcodeproj/**', 'utils/set_dylibs_rpath.sh', 'utils/fetch_sdl2_framework.sh') }}
- name: Compile
if: steps.cache-artifact.outputs.cache-hit != 'true'
run: xcodebuild -configuration "Release" -jobs $(sysctl -n hw.logicalcpu) -quiet
- name: Compile Engine
if: (!steps.cache-engine.outputs.cache-hit)
run: xcodebuild -target "${{ env.ENGINE }}" -configuration Release -jobs $(sysctl -n hw.logicalcpu) -quiet
- name: Compile Game
if: (!steps.cache-game_artifact.outputs.cache-hit)
run: xcodebuild -target "${{ env.GAME_ARTIFACT }}" -configuration Release -jobs $(sysctl -n hw.logicalcpu) -quiet
- name: Compile Unit Tests
if: (!steps.cache-unittest_artifact.outputs.cache-hit)
run: xcodebuild -target "${{ env.UNITTEST_ARTIFACT }}" -configuration Release -jobs $(sysctl -n hw.logicalcpu) -quiet
- name: Prepare engine framework
if: (!steps.cache-engine.outputs.cache-hit)
run: mv "build/Release/${{ env.ENGINE }}.framework/Versions/Current/${{ env.ENGINE }}" .
- name: Upload engine framework
uses: actions/upload-artifact@v2
with:
name: engine-${{ matrix.os }}
path: ${{ env.ENGINE }}
- name: Prepare game binary
if: steps.cache-artifact.outputs.cache-hit != 'true'
run: mv "build/Release/Endless Sky.app/Contents/MacOS/Endless Sky" .
if: (!steps.cache-game_artifact.outputs.cache-hit)
run: mv "build/Release/${{ env.GAME_ARTIFACT }}.app/Contents/MacOS/${{ env.GAME_ARTIFACT }}" .
- name: Upload game binary
uses: actions/upload-artifact@v2
with:
name: binary-${{ matrix.os }}
path: ${{ env.ARTIFACT }}
path: ${{ env.GAME_ARTIFACT }}
- name: Prepare unit tests binary
if: (!steps.cache-unittest_artifact.outputs.cache-hit)
run: mv "build/Release/${{ env.UNITTEST_ARTIFACT }}.app/Contents/MacOS/${{ env.UNITTEST_ARTIFACT }}" .
- name: Upload unit tests binary
uses: actions/upload-artifact@v2
with:
name: unittest-${{ matrix.os }}
path: ${{ env.UNITTEST_ARTIFACT }}


test_macos-unit:
needs: [build_macos, changed]
if: ${{ needs.changed.outputs.macos == 'true' || needs.changed.outputs.unit_tests == 'true' }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
env:
ENGINE: ES_Engine
UNITTESTS: ES_UnitTests
SDL2_FRAMEWORK: build/SDL2.framework
steps:
- uses: actions/checkout@v2
- name: Update Homebrew
run: brew update
- name: Install dependencies
run: brew install libmad libpng jpeg-turbo
- name: Restore cached SDL2 framework
uses: actions/cache@v2
with:
path: ${{ env.SDL2_FRAMEWORK }}
key: ${{ matrix.os }}-sdl2-${{ hashFiles('.github/workflows/ci.yml', 'EndlessSky.xcodeproj/**', 'utils/set_dylibs_rpath.sh', 'utils/fetch_sdl2_framework.sh') }}
- name: Create empty app structure
run: mkdir -p Contents/Frameworks/${{ env.ENGINE }}.framework/Versions/A/Frameworks Contents/MacOS Contents/Resources
- name: Download engine binary
uses: actions/download-artifact@v2
with:
name: engine-${{ matrix.os }}
path: Contents/Frameworks/${{ env.ENGINE }}.framework/Versions/A
- name: Add support files
run: |
ln -s /usr/local/opt/libmad/lib/libmad.0.dylib Contents/Frameworks/${{ env.ENGINE }}.framework/Versions/A/Frameworks/
ln -s /usr/local/opt/libpng/lib/libpng16.dylib Contents/Frameworks/${{ env.ENGINE }}.framework/Versions/A/Frameworks/
ln -s /usr/local/opt/jpeg-turbo/lib/libturbojpeg.0.dylib Contents/Frameworks/${{ env.ENGINE }}.framework/Versions/A/Frameworks/
mv ${{ env.SDL2_FRAMEWORK }} Contents/Frameworks/${{ env.ENGINE }}.framework/Versions/A/Frameworks
cd Contents/Resources/
ln -s ../../data
ln -s ../../images
ln -s ../../sounds
- name: Download unit tests binary
uses: actions/download-artifact@v2
with:
name: unittest-${{ matrix.os }}
path: Contents/MacOS
- name: Give executable permissions
run: chmod +x "Contents/MacOS/${{ env.UNITTESTS }}"
- name: Run unit tests
run: Contents/MacOS/${{ env.UNITTESTS }} -r compact
- name: Run benchmarks
run: Contents/MacOS/${{ env.UNITTESTS }} [!benchmark]


# This section is for tests on ubuntu 16 (and on ubuntu 20).
Expand Down Expand Up @@ -426,7 +514,8 @@ jobs:
matrix:
os: [macos-latest]
env:
ES_BINARY: Endless Sky
ENGINE: ES_Engine
GAME: Endless Sky
SDL2_FRAMEWORK: build/SDL2.framework
steps:
- uses: actions/checkout@v2
Expand All @@ -439,13 +528,19 @@ jobs:
with:
path: ${{ env.SDL2_FRAMEWORK }}
key: ${{ matrix.os }}-sdl2-${{ hashFiles('.github/workflows/ci.yml', 'EndlessSky.xcodeproj/**', 'utils/set_dylibs_rpath.sh', 'utils/fetch_sdl2_framework.sh') }}
- name: Create empty app structure
run: mkdir -p Contents/Frameworks/${{ env.ENGINE }}.framework/Versions/A/Frameworks Contents/MacOS Contents/Resources
- name: Download engine binary
uses: actions/download-artifact@v2
with:
name: engine-${{ matrix.os }}
path: Contents/Frameworks/${{ env.ENGINE }}.framework/Versions/A
- name: Add support files
run: |
mkdir -p Contents/Frameworks Contents/MacOS Contents/Resources
ln -s /usr/local/opt/libmad/lib/libmad.0.dylib Contents/Frameworks/
ln -s /usr/local/opt/libpng/lib/libpng16.dylib Contents/Frameworks/
ln -s /usr/local/opt/jpeg-turbo/lib/libturbojpeg.0.dylib Contents/Frameworks/
mv ${{ env.SDL2_FRAMEWORK }} Contents/Frameworks/
ln -s /usr/local/opt/libmad/lib/libmad.0.dylib Contents/Frameworks/${{ env.ENGINE }}.framework/Versions/A/Frameworks/
ln -s /usr/local/opt/libpng/lib/libpng16.dylib Contents/Frameworks/${{ env.ENGINE }}.framework/Versions/A/Frameworks/
ln -s /usr/local/opt/jpeg-turbo/lib/libturbojpeg.0.dylib Contents/Frameworks/${{ env.ENGINE }}.framework/Versions/A/Frameworks/
mv ${{ env.SDL2_FRAMEWORK }} Contents/Frameworks/${{ env.ENGINE }}.framework/Versions/A/Frameworks
cd Contents/Resources/
ln -s ../../data
ln -s ../../images
Expand All @@ -456,9 +551,9 @@ jobs:
name: binary-${{ matrix.os }}
path: Contents/MacOS
- name: Verify Executable
run: chmod +x "Contents/MacOS/${ES_BINARY}" && ./"Contents/MacOS/${ES_BINARY}" -v
run: chmod +x "Contents/MacOS/${{ env.GAME }}" && ./"Contents/MacOS/${{ env.GAME }}" -v
- name: Parse Datafiles
run: ./utils/test_parse.sh ./"Contents/MacOS/${ES_BINARY}"
run: ./utils/test_parse.sh ./"Contents/MacOS/${{ env.GAME }}"


test_memory-leaks-lite:
Expand Down
8 changes: 4 additions & 4 deletions EndlessSky.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1681,7 +1681,7 @@
/usr/local/include,
);
INFOPLIST_FILE = "$(SRCROOT)/XCode/EndlessSky-info.plist";
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks @executable_path/../Frameworks";
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks @executable_path/../Frameworks @loader_path/../Frameworks/ES_Engine.framework/Versions/A/Frameworks @executable_path/../Frameworks/ES_Engine.framework/Versions/A/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)",
Expand Down Expand Up @@ -1712,7 +1712,7 @@
/usr/local/include,
);
INFOPLIST_FILE = "$(SRCROOT)/XCode/EndlessSky-info.plist";
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks @executable_path/../Frameworks";
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks @executable_path/../Frameworks @loader_path/../Frameworks/ES_Engine.framework/Versions/A/Frameworks @executable_path/../Frameworks/ES_Engine.framework/Versions/A/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)",
Expand Down Expand Up @@ -1831,7 +1831,7 @@
/usr/local/include,
);
INFOPLIST_FILE = "$(SRCROOT)/XCode/ES_UnitTests-info.plist";
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks";
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks @executable_path/../Frameworks @loader_path/../Frameworks/ES_Engine.framework/Versions/A/Frameworks @executable_path/../Frameworks/ES_Engine.framework/Versions/A/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)",
Expand Down Expand Up @@ -1860,7 +1860,7 @@
/usr/local/include,
);
INFOPLIST_FILE = "$(SRCROOT)/XCode/ES_UnitTests-info.plist";
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks";
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks @executable_path/../Frameworks @loader_path/../Frameworks/ES_Engine.framework/Versions/A/Frameworks @executable_path/../Frameworks/ES_Engine.framework/Versions/A/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)",
Expand Down