ci: 最大200行を守るためのステップを追加 #399
Workflow file for this run
This file contains hidden or 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
| name: Build on Windows | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| # Setup | |
| - uses: ilammy/msvc-dev-cmd@v1 | |
| - uses: seanmiddleditch/gha-setup-ninja@master | |
| - name: Install dependencies | |
| run: choco install pkgconfiglite | |
| - name: install meson | |
| run: pip install meson | |
| - name: Cache vcpkg packages | |
| id: cache-vcpkg | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| vcpkg_installed_static | |
| vcpkg_installed_shared | |
| vcpkg/buildtrees | |
| vcpkg/packages | |
| vcpkg/vcpkg.exe | |
| key: ${{ runner.os }}-vcpkg-${{ hashFiles('vcpkg.json', 'triplets/**', '.gitmodules') }} | |
| # Static | |
| - name: Setup vcpkg packages (static) | |
| if: steps.cache-vcpkg.outputs.cache-hit != 'true' | |
| run: scripts\setup-vcpkg.bat static | |
| - name: Build & install orge (static) | |
| run: | | |
| meson setup build-static ` | |
| -Dbuild_examples=true ` | |
| -Dbuildtype=release ` | |
| -Db_vscrt=mt ` | |
| --prefix=D:\orge\installed-static ` | |
| --cmake-prefix-path=${{ github.workspace }}\vcpkg_installed_static\custom-x64-windows-static ` | |
| --default-library=static | |
| meson install -C build-static | |
| tree /f D:\orge\installed-static | |
| # Shared | |
| - name: Install vcpkg packages (shared) | |
| if: steps.cache-vcpkg.outputs.cache-hit != 'true' | |
| run: scripts\setup-vcpkg.bat shared | |
| - name: Build & install orge (shared) | |
| run: | | |
| meson setup build-shared ` | |
| -Dbuild_examples=true ` | |
| -Dbuildtype=release ` | |
| -Db_vscrt=md ` | |
| --prefix=D:\orge\installed-shared ` | |
| --cmake-prefix-path=${{ github.workspace }}\vcpkg_installed_shared\custom-x64-windows-shared ` | |
| --default-library=shared | |
| meson install -C build-shared | |
| tree /f D:\orge\installed-shared | |
| # Post | |
| - name: Copy example file | |
| run: copy examples\simple\main.cpp D:\orge\ | |
| - name: Upload orge artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: orge-lib | |
| path: D:\orge | |
| - name: Prepare uploading orge artifacts (for release) | |
| if: startsWith(github.head_ref, 'release') | |
| run: | | |
| mkdir D:\orge\installed-static\licenses | |
| mkdir D:\orge\installed-shared\licenses | |
| xcopy licenses D:\orge\installed-static\licenses /E /I | |
| xcopy licenses D:\orge\installed-shared\licenses /E /I | |
| - name: Upload orge artifacts (for release) (static) | |
| if: startsWith(github.head_ref, 'release') | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: orge-x64-windows-static | |
| path: D:\orge\installed-static | |
| - name: Upload orge artifacts (for release) (shared) | |
| if: startsWith(github.head_ref, 'release') | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: orge-x64-windows-shared | |
| path: D:\orge\installed-shared | |
| test-standalone: | |
| runs-on: windows-latest | |
| needs: build | |
| steps: | |
| - uses: ilammy/msvc-dev-cmd@v1 | |
| - name: Install dependencies | |
| run: choco install pkgconfiglite | |
| - name: Download orge artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: orge-lib | |
| path: D:\orge | |
| - name: Prepare | |
| run: | | |
| mkdir shared | |
| mkdir static | |
| - name: Test build with static | |
| working-directory: static | |
| shell: cmd | |
| env: | |
| PKG_CONFIG_PATH: D:\orge\installed-static\lib\pkgconfig | |
| run: | | |
| for /f "delims=" %%i in ('pkg-config orge --cflags') do set CFLAGS=%%i | |
| for /f "delims=" %%j in ('pkg-config orge --libs --static') do set LIBS=%%j | |
| echo %CFLAGS% | |
| echo %LIBS% | |
| clang++ %CFLAGS% D:\orge\main.cpp %LIBS% | |
| - name: Test build with shared | |
| working-directory: shared | |
| shell: cmd | |
| env: | |
| PKG_CONFIG_PATH: D:\orge\installed-shared\lib\pkgconfig | |
| run: | | |
| for /f "delims=" %%i in ('pkg-config orge --cflags') do set CFLAGS=%%i | |
| for /f "delims=" %%j in ('pkg-config orge --libs') do set LIBS=%%j | |
| echo %CFLAGS% | |
| echo %LIBS% | |
| clang++ %CFLAGS% -DORGE_USE_SHARED D:\orge\main.cpp %LIBS% |