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

Add macos #149

Merged
merged 7 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
82 changes: 82 additions & 0 deletions .github/workflows/build-and-run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Hop run tests

on:
pull_request:
workflow_dispatch:

jobs:
linuxRunTest:
runs-on: ubuntu-22.04

strategy:
matrix:
example: [PerlinWorld, SoftBodyTetris, MeshEditor]

steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y build-essential xorg-dev mesa-common-dev libx11-dev libxrandr-dev libgl1-mesa-dev libglu1-mesa-dev libfreetype6-dev libopenal-dev libsndfile1-dev libudev-dev libxinerama-dev libxcursor-dev xvfb x11-apps vulkan-tools libvulkan-dev vulkan-validationlayers-dev spirv-tools

- name: linux-linux
run: |
./build.sh -r -d

- name: run ${{ matrix.example }}
run: |
cd build/${{ matrix.example }}
chmod +x ${{ matrix.example }}
export DISPLAY=:99
sudo Xvfb :99 -screen 0 800x600x24 &
sleep 5
MESA_GL_VERSION_OVERRIDE=3.3 ./${{ matrix.example }} &
export PID=$!
sleep 10
xwd -root -silent | convert xwd:- png:screenshot.png
sleep 5 && kill $PID

- name: upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.example }}.png
path: build/${{ matrix.example }}/screenshot.png

wineRunTest:
if: ${{ github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-22.04

strategy:
matrix:
example: [PerlinWorld, SoftBodyTetris, MeshEditor]

steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y xorg-dev build-essential mesa-common-dev libx11-dev libxrandr-dev libgl1-mesa-dev libglu1-mesa-dev libfreetype6-dev libopenal-dev libsndfile1-dev libudev-dev g++-mingw-w64-x86-64-posix gcc-mingw-w64-x86-64-posix libxinerama-dev libxcursor-dev xvfb x11-apps vulkan-tools libvulkan-dev vulkan-validationlayers-dev spirv-tools wine64
- name: linux-windows
run: |
./build.sh -r -w -d

- name: run ${{ matrix.example }}
run: |
cd build/${{ matrix.example }}
chmod +x ${{ matrix.example }}.exe
export DISPLAY=:99
sudo Xvfb :99 -screen 0 800x600x24 &
sleep 5
MESA_GL_VERSION_OVERRIDE=3.3 wine64 ${{ matrix.example }}.exe &
export PID=$!
sleep 10
xwd -root -silent | convert xwd:- png:screenshot.png
sleep 5 && kill $PID

- name: upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.example }}-wine.png
path: build/${{ matrix.example }}/screenshot.png
99 changes: 99 additions & 0 deletions .github/workflows/build-and-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Hop unit tests

on:
pull_request:
workflow_dispatch:

jobs:
linuxUnitTest:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y build-essential xorg-dev mesa-common-dev libx11-dev libxrandr-dev libgl1-mesa-dev libglu1-mesa-dev libfreetype6-dev libopenal-dev libsndfile1-dev libudev-dev libxinerama-dev libxcursor-dev vulkan-tools libvulkan-dev vulkan-validationlayers-dev spirv-tools

- name: linux-linux
run: |
git submodule update --recursive
./build.sh -t -d -r

- name: Tests
working-directory: ${{github.workspace}}/build
run: ctest --output-on-failure

linuxWineUnitTest:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y xorg-dev build-essential mesa-common-dev libx11-dev libxrandr-dev libgl1-mesa-dev libglu1-mesa-dev libfreetype6-dev libopenal-dev libsndfile1-dev libudev-dev g++-mingw-w64-x86-64-posix gcc-mingw-w64-x86-64-posix libxinerama-dev libxcursor-dev vulkan-tools libvulkan-dev vulkan-validationlayers-dev spirv-tools wine64
- name: linux-windows
run: |
./build.sh -t -r -d -w

- name: Tests
working-directory: ${{github.workspace}}/build
run: ctest --output-on-failure

macOS:
runs-on: macos-11

steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Install dependencies
run: |
wget https://vulkan.lunarg.com/sdk/download/1.2.189.0/mac/vulkansdk-macos-1.2.189.0.dmg
hdiutil attach vulkansdk-macos-1.2.189.0.dmg
mkdir ~/vulkan
cd /Volumes/vulkansdk-macos-1.2.189.0/
sudo ./InstallVulkan.app/Contents/macOS/InstallVulkan --root ~/vulkan --accept-licenses --default-answer --confirm-command install
ls ~/vulkan
cd ~/vulkan/
python install_vulkan.py

- name: macos-macos
run: ./build.sh -o -t -d -r

- name: Tests
working-directory: ${{github.workspace}}/build
run: ctest --output-on-failure

linuxXandroid:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install -y build-essential mesa-common-dev libx11-dev libxrandr-dev libgl1-mesa-dev libglu1-mesa-dev libfreetype6-dev libopenal-dev libsndfile1-dev libudev-dev vulkan-tools libvulkan-dev vulkan-validationlayers-dev spirv-tools
wget https://dl.google.com/android/repository/android-ndk-r25c-linux.zip
unzip android-ndk-r25c-linux.zip
wget https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip
unzip commandlinetools-linux-9477386_latest.zip
export ANDROID_SDK_ROOT=~/
mv cmdline-tools latest
mkdir cmdline-tools
mv latest cmdline-tools
yes | ./cmdline-tools/latest/bin/sdkmanager --licenses
./cmdline-tools/latest/bin/sdkmanager --install "system-images;android-33;google_apis;x86_64"
./cmdline-tools/latest/bin/sdkmanager "platform-tools" "platforms;android-33"
echo no | ./cmdline-tools/latest/bin/avdmanager create avd --name android33 --package "system-images;android-33;google_apis;x86_64"

- name: build hop
run: |
git submodule update --recursive
./build.sh -r --android android-ndk-r25c
Loading