From 647fb7480653ad3024b734b23cd2d3af8aa1993c Mon Sep 17 00:00:00 2001 From: kunitoki Date: Mon, 16 Dec 2024 16:58:33 +0100 Subject: [PATCH] Fix wasm and windows --- .github/workflows/build_wasm.yml | 5 -- .github/workflows/build_windows.yml | 117 +++++++++++++++++++++------- 2 files changed, 88 insertions(+), 34 deletions(-) diff --git a/.github/workflows/build_wasm.yml b/.github/workflows/build_wasm.yml index c84fa4ec..23306758 100644 --- a/.github/workflows/build_wasm.yml +++ b/.github/workflows/build_wasm.yml @@ -51,11 +51,6 @@ jobs: working-directory: ${{runner.workspace}}/build run: emcmake cmake $GITHUB_WORKSPACE -G "Ninja Multi-Config" -DYUP_ENABLE_TESTS=ON -DYUP_ENABLE_EXAMPLES=ON - - name: Build SDL2 - run: | - cmake --build ${{runner.workspace}}/build --config Debug --parallel 4 --target SDL2-static - cmake --build ${{runner.workspace}}/build --config Release --parallel 4 --target SDL2-static - - name: Cache Configure id: cache-build uses: actions/cache/save@v4 diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml index ae7c8b50..8dbc2847 100644 --- a/.github/workflows/build_windows.yml +++ b/.github/workflows/build_windows.yml @@ -26,12 +26,11 @@ concurrency: cancel-in-progress: true jobs: - test: + configure: runs-on: windows-latest steps: - uses: actions/checkout@v4 - - uses: seanmiddleditch/gha-setup-ninja@master - name: Create Build Environment @@ -41,36 +40,96 @@ jobs: working-directory: ${{runner.workspace}}/build run: cmake ${{ github.workspace }} -DYUP_ENABLE_TESTS=ON -DYUP_ENABLE_EXAMPLES=ON - - name: Build Tests Debug - working-directory: ${{runner.workspace}}/build - run: cmake --build . --config Debug --parallel 4 --target yup_tests + - name: Build SDL2 + run: | + cmake --build ${{runner.workspace}}/build --config Debug --parallel 4 --target SDL2-static + cmake --build ${{runner.workspace}}/build --config Release --parallel 4 --target SDL2-static - - name: Execute Tests Debug - working-directory: ${{runner.workspace}}/build/tests/Debug + - name: Cache Configure + id: cache-build + uses: actions/cache/save@v4 + with: + path: ${{runner.workspace}}/build + key: ${{ runner.os }}-build-${{ github.sha }} + + build_tests: + runs-on: windows-latest + needs: [configure] + steps: + - uses: actions/checkout@v4 + - uses: seanmiddleditch/gha-setup-ninja@master + - uses: actions/cache/restore@v4 + with: + path: ${{runner.workspace}}/build + key: ${{ runner.os }}-build-${{ github.sha }} + - run: cmake --build ${{runner.workspace}}/build --config Debug --parallel 4 --target yup_tests + - working-directory: ${{runner.workspace}}/build/tests/Debug + run: ./yup_tests.exe + - run: cmake --build ${{runner.workspace}}/build --config Release --parallel 4 --target yup_tests + - working-directory: ${{runner.workspace}}/build/tests/Release run: ./yup_tests.exe - - name: Build Tests Release - working-directory: ${{runner.workspace}}/build - run: cmake --build . --config Release --parallel 4 --target yup_tests + build_console: + runs-on: windows-latest + needs: [configure] + steps: + - uses: actions/checkout@v4 + - uses: seanmiddleditch/gha-setup-ninja@master + - uses: actions/cache/restore@v4 + with: + path: ${{runner.workspace}}/build + key: ${{ runner.os }}-build-${{ github.sha }} + - run: cmake --build ${{runner.workspace}}/build --config Debug --parallel 4 --target example_console + - run: cmake --build ${{runner.workspace}}/build --config Release --parallel 4 --target example_console - - name: Execute Tests Release - working-directory: ${{runner.workspace}}/build/tests/Release - run: ./yup_tests.exe + build_app: + runs-on: windows-latest + needs: [configure] + steps: + - uses: actions/checkout@v4 + - uses: seanmiddleditch/gha-setup-ninja@master + - uses: actions/cache/restore@v4 + with: + path: ${{runner.workspace}}/build + key: ${{ runner.os }}-build-${{ github.sha }} + - run: cmake --build ${{runner.workspace}}/build --config Debug --parallel 4 --target example_app + - run: cmake --build ${{runner.workspace}}/build --config Release --parallel 4 --target example_app - - name: Build Examples Debug - working-directory: ${{runner.workspace}}/build - run: | - cmake --build . --config Debug --parallel 4 --target example_console - cmake --build . --config Debug --parallel 4 --target example_app - cmake --build . --config Debug --parallel 4 --target example_graphics - cmake --build . --config Debug --parallel 4 --target example_render - cmake --build . --config Debug --parallel 4 --target example_plugin + build_graphics: + runs-on: windows-latest + needs: [configure] + steps: + - uses: actions/checkout@v4 + - uses: seanmiddleditch/gha-setup-ninja@master + - uses: actions/cache/restore@v4 + with: + path: ${{runner.workspace}}/build + key: ${{ runner.os }}-build-${{ github.sha }} + - run: cmake --build ${{runner.workspace}}/build --config Debug --parallel 4 --target example_graphics + - run: cmake --build ${{runner.workspace}}/build --config Release --parallel 4 --target example_graphics - - name: Build Examples Release - working-directory: ${{runner.workspace}}/build - run: | - cmake --build . --config Release --parallel 4 --target example_console - cmake --build . --config Release --parallel 4 --target example_app - cmake --build . --config Release --parallel 4 --target example_graphics - cmake --build . --config Release --parallel 4 --target example_render - cmake --build . --config Release --parallel 4 --target example_plugin + build_render: + runs-on: windows-latest + needs: [configure] + steps: + - uses: actions/checkout@v4 + - uses: seanmiddleditch/gha-setup-ninja@master + - uses: actions/cache/restore@v4 + with: + path: ${{runner.workspace}}/build + key: ${{ runner.os }}-build-${{ github.sha }} + - run: cmake --build ${{runner.workspace}}/build --config Debug --parallel 4 --target example_render + - run: cmake --build ${{runner.workspace}}/build --config Release --parallel 4 --target example_render + + build_plugin: + runs-on: windows-latest + needs: [configure] + steps: + - uses: actions/checkout@v4 + - uses: seanmiddleditch/gha-setup-ninja@master + - uses: actions/cache/restore@v4 + with: + path: ${{runner.workspace}}/build + key: ${{ runner.os }}-build-${{ github.sha }} + - run: cmake --build ${{runner.workspace}}/build --config Debug --parallel 4 --target example_plugin + - run: cmake --build ${{runner.workspace}}/build --config Release --parallel 4 --target example_plugin