Skip to content

Commit

Permalink
ci: fix macos build and resolution error
Browse files Browse the repository at this point in the history
  • Loading branch information
Chance.H committed Sep 11, 2024
1 parent 7268251 commit 330a87e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ jobs:
- name: Start Xvfb
run: |
nohup Xvfb :99 -screen 0 1024x768x24 &
nohup Xvfb :99 -screen 0 800x600x24 &
echo "DISPLAY=:99" >> $GITHUB_ENV
- name: Run demo2d
run: |
for i in {1..7}; do
# Start recording with ffmpeg
ffmpeg -y -f x11grab -video_size 1024x768 -i :99 -t 5 -r 10 ./build/bin/demo2d_$i.gif &
ffmpeg -y -f x11grab -video_size 800x600 -i :99 -t 5 -r 10 ./build/bin/demo2d_$i.gif &
FFmpeg_PID=$!
# Run the demo2d program in the background
./build/bin/demo2d --instruction $i &
Expand All @@ -83,7 +83,7 @@ jobs:
- name: Run MassSpring3D
run: |
for i in {1..1}; do
ffmpeg -y -f x11grab -video_size 1024x768 -i :99 -t 5 -r 10 ./build/bin/MassSpring3D_$i.gif &
ffmpeg -y -f x11grab -video_size 800x600 -i :99 -t 5 -r 10 ./build/bin/MassSpring3D_$i.gif &
FFmpeg_PID=$!
./build/bin/MassSpring3D --instruction $i &
MassSpring3D_PID=$!
Expand Down Expand Up @@ -123,9 +123,12 @@ jobs:
- name: Start Xvfb
run: |
sudo Xvfb :99 -screen 0 1024x768x24 &
sudo Xvfb :99 -screen 0 800x600x24 &
echo "DISPLAY=:99" >> $GITHUB_ENV
sleep 3 # Give Xvfb some time to start
export DISPLAY=:99
xset -q # Check if Xvfb is running
- name: Build
run: |
cmake --preset=build
Expand All @@ -135,7 +138,7 @@ jobs:
run: |
for i in {1..7}; do
# Start recording with ffmpeg
ffmpeg -y -f x11grab -video_size 1024x768 -i :99 -t 5 -r 10 ./build/bin/demo2d_$i.gif &
ffmpeg -y -f x11grab -video_size 800x600 -i :99 -t 5 -r 10 ./build/bin/demo2d_$i.gif &
FFmpeg_PID=$!
# Run the demo2d program in the background
./build/bin/demo2d --instruction $i &
Expand All @@ -153,7 +156,7 @@ jobs:
- name: Run MassSpring3D
run: |
for i in {1..1}; do
ffmpeg -y -f x11grab -video_size 1024x768 -i :99 -t 5 -r 10 ./build/bin/MassSpring3D_$i.gif &
ffmpeg -y -f x11grab -video_size 800x600 -i :99 -t 5 -r 10 ./build/bin/MassSpring3D_$i.gif &
FFmpeg_PID=$!
./build/bin/MassSpring3D --instruction $i &
MassSpring3D_PID=$!
Expand Down
2 changes: 1 addition & 1 deletion test/system_test/MassSpring3D/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void idle() {
static void initGlutState(int argc, char** argv, const char* window_title = "", const unsigned int window_width = 800, const unsigned int window_height = 600) {
glutInit(&argc, argv);
glutInitWindowSize(window_width, window_height);
glutInitWindowPosition(50, 50);
glutInitWindowPosition(0, 0);
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH); /// TODO
glutCreateWindow(window_title);
glutDisplayFunc(&display);
Expand Down
2 changes: 1 addition & 1 deletion test/system_test/demo2d/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ int main(int argc, char* argv[]) {

glutInit(&argc, argv);
glutInitWindowSize(SCREEN_WIDTH, SCREEN_HEIGHT);
glutInitWindowPosition(50, 50);
glutInitWindowPosition(0, 0);
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE);
glutCreateWindow("SimplePhysicsEngine-ST-demo2d");
// world.Init();
Expand Down

0 comments on commit 330a87e

Please sign in to comment.