Update build.yml #26
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 starter workflow is for a CMake project running on a single platform. There is a different starter workflow if you need cross-platform coverage. | |
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml | |
name: build | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
env: | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
BUILD_TYPE: Release | |
jobs: | |
linux-static: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Skylicht Engine | |
uses: actions/checkout@v4 | |
with: | |
repository: skylicht-lab/skylicht-engine | |
path: skylicht-engine | |
- name: Checkout Project | |
uses: actions/checkout@v4 | |
with: | |
path: hello | |
- name: Install Dependencies | |
run: | | |
sudo apt-get update -y -qq | |
sudo apt-get install -y libglfw3-dev libopenal-dev libx11-dev | |
- name: Build Skylicht | |
run: | | |
cd skylicht-engine | |
cmake -S. -BPrjLinux -DINSTALL_LIBS=ON | |
cmake --build ./PrjLinux --target install | |
cp -r ./InstallLibs ../hello | |
cd .. | |
- name: Build Project | |
run: | | |
cd hello | |
ls -l | |
cmake -S. -BPrjLinux | |
cmake --build ./PrjLinux | |
cd .. | |
- name: Unit Test | |
run: | | |
cd hello/PrjLinux | |
ctest --verpose | |
cat Testing/Temporary/LastTest.log | |
cd ../.. | |
- name: Package | |
run: | | |
cd hello | |
ls -l Bin | |
linux-shared: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Skylicht Engine | |
uses: actions/checkout@v4 | |
with: | |
repository: skylicht-lab/skylicht-engine | |
path: skylicht-engine | |
- name: Checkout Project | |
uses: actions/checkout@v4 | |
with: | |
path: hello | |
- name: Install Dependencies | |
run: | | |
sudo apt-get update -y -qq | |
sudo apt-get install -y libglfw3-dev libopenal-dev libx11-dev | |
- name: Build Skylicht | |
run: | | |
cd skylicht-engine | |
cmake -S. -BPrjLinux -DINSTALL_LIBS=ON -DBUILD_SHARED_LIBS=ON | |
cmake --build ./PrjLinux --target install | |
cp -r ./InstallLibs ../hello | |
cp ./InstallLibs/lib/*.* ../hello/Bin | |
cd .. | |
- name: Build Project | |
run: | | |
cd hello | |
ls -l | |
cmake -S. -BPrjLinux -DUSE_SKYLICHT_SHARED_LIBS=ON | |
cmake --build ./PrjLinux | |
cd .. | |
- name: Unit Test | |
run: | | |
cd hello/PrjLinux | |
ctest --verpose | |
cat Testing/Temporary/LastTest.log | |
cd ../.. | |
- name: Package | |
run: | | |
cd hello | |
ls -l Bin | |
windows-static: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout Skylicht Engine | |
uses: actions/checkout@v4 | |
with: | |
repository: skylicht-lab/skylicht-engine | |
path: skylicht-engine | |
- name: Checkout Project | |
uses: actions/checkout@v4 | |
with: | |
path: hello | |
- name: Build Skylicht | |
run: | | |
cd skylicht-engine | |
cmake -S . -B ./PrjVisualStudio -G "Visual Studio 17 2022" -A x64 -DINSTALL_LIBS=ON | |
cmake --build ./PrjVisualStudio --target install --config "Release" | |
cp -r ./InstallLibs ../hello | |
cd .. | |
- name: Build Project | |
run: | | |
cd hello | |
dir | |
cmake -S . -B ./PrjVisualStudio -G "Visual Studio 17 2022" -A x64 | |
cmake --build ./PrjVisualStudio --config "Release" | |
cd .. | |
- name: Unit Test | |
run: | | |
cd hello/PrjVisualStudio | |
ctest --verpose -C Release | |
cat Testing/Temporary/LastTest.log | |
cd ../.. | |
- name: Package | |
run: | | |
cd hello | |
dir Bin | |
dir Bin/Release | |
windows-shared: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout Skylicht Engine | |
uses: actions/checkout@v4 | |
with: | |
repository: skylicht-lab/skylicht-engine | |
path: skylicht-engine | |
- name: Checkout Project | |
uses: actions/checkout@v4 | |
with: | |
path: hello | |
- name: Build Skylicht | |
run: | | |
cd skylicht-engine | |
cmake -S . -B ./PrjVisualStudio -G "Visual Studio 17 2022" -A x64 -DINSTALL_LIBS=ON -DBUILD_SHARED_LIBS=ON | |
cmake --build ./PrjVisualStudio --target install | |
cp -r ./InstallLibs ../hello | |
md ../hello/Bin/Release | |
cp ./InstallLibs/*.dll ../hello/Bin/Release | |
cd .. | |
- name: Build Project | |
run: | | |
cd hello | |
dir | |
cmake -S . -B ./PrjVisualStudio -G "Visual Studio 17 2022" -A x64 -DUSE_SKYLICHT_SHARED_LIBS=ON | |
cmake --build ./PrjVisualStudio | |
cd .. | |
- name: Unit Test | |
run: | | |
cd hello/PrjVisualStudio | |
ctest --verpose -C Release | |
cat Testing/Temporary/LastTest.log | |
cd ../.. | |
- name: Package | |
run: | | |
cd hello | |
dir Bin | |
dir Bin/Release | |
macosx: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout Skylicht Engine | |
uses: actions/checkout@v4 | |
with: | |
repository: skylicht-lab/skylicht-engine | |
path: skylicht-engine | |
- name: Checkout Project | |
uses: actions/checkout@v4 | |
with: | |
path: hello | |
- name: Build Skylicht | |
run: | | |
brew install libomp | |
cd skylicht-engine | |
cmake -S . -B ./PrjMac -G Xcode -DCMAKE_OSX_ARCHITECTURES=x86_64 -DINSTALL_LIBS=ON | |
cmake --build ./PrjMac --target install --config Release | |
cp -r ./InstallLibs ../hello | |
cd .. | |
- name: Build Project | |
run: | | |
cd hello | |
ls -l | |
cmake -S . -B ./PrjMac -G Xcode -DCMAKE_OSX_ARCHITECTURES=x86_64 | |
cd PrjMac | |
xcodebuild -configuration Release | |
cd .. | |
- name: Unit Test | |
run: | | |
cd hello/PrjMac | |
ctest --verpose -C Release | |
cat Testing/Temporary/LastTest.log | |
cd ../.. | |
- name: Package | |
run: | | |
cd hello | |
ls -l Bin |