Skip to content

Commit

Permalink
ci: use ninja
Browse files Browse the repository at this point in the history
  • Loading branch information
madebr committed Sep 8, 2023
1 parent b7b0a4c commit 667edba
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 41 deletions.
54 changes: 30 additions & 24 deletions .github/workflows/CMake-MSVC-noyasm.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
name: CMake MSVC noyasm

on: push

jobs:
build:
defaults:
run:
shell: cmd
strategy:
matrix:
# currently windows-latest==windows-2022
# windows-2022: VS2022
# windows-2019: VS2019
os: [windows-2022, windows-2019]
arch: [Win32, x64, ARM, ARM64]
shared: [ON, OFF]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: CMake
run: cd ports\cmake && cmake -A ${{ matrix.arch }} -DBUILD_SHARED_LIBS=${{ matrix.shared }} .
- name: CMake --build
run: cd ports\cmake && cmake --build .
name: CMake MSVC noyasm

on: push

jobs:
build:
defaults:
run:
shell: cmd
strategy:
matrix:
# currently windows-latest==windows-2022
# windows-2022: VS2022
# windows-2019: VS2019
os: [windows-2022, windows-2019]
arch: [x86, x64, amd64_arm, amd64_arm64]
shared: [ON, OFF]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Setup vcvars
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- name: Install ninja
uses: turtlesec-no/get-ninja@main
- name: CMake (configure)
run: cmake -S ports\cmake -B build -GNinja -DBUILD_SHARED_LIBS=${{ matrix.shared }} .
- name: CMake --build
run: cmake --build build
48 changes: 31 additions & 17 deletions .github/workflows/CMake-MSVC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,27 @@ jobs:
with:
repository: yasm/yasm
path: yasm-src
- name: Build and install yasm
if: ${{ !steps.restore-yasm.outputs.cache-hit }}
run: |
cmake -S yasm-src -B yasm-build -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/yasm -DCMAKE_INSTALL_LIBDIR=bin -DCMAKE_INSTALL_BINDIR=bin -A x64 -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
cmake --build yasm-build --parallel --config Release
cmake --install yasm-build --config Release
- name: Cache yasm
if: ${{ !steps.restore-yasm.outputs.cache-hit }}
uses: actions/cache/save@v3
with:
path: |
${{ github.workspace }}/yasm
key: yasm
- name: Setup vcvars
if: ${{ !steps.restore-yasm.outputs.cache-hit }}
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Install ninja
if: ${{ !steps.restore-yasm.outputs.cache-hit }}
uses: turtlesec-no/get-ninja@main
- name: Build and install yasm
if: ${{ !steps.restore-yasm.outputs.cache-hit }}
run: |
cmake -S yasm-src -B yasm-build -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/yasm -DCMAKE_INSTALL_LIBDIR=bin -DCMAKE_INSTALL_BINDIR=bin -A x64 -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
cmake --build yasm-build --parallel
cmake --install yasm-build
- name: Cache yasm
if: ${{ !steps.restore-yasm.outputs.cache-hit }}
uses: actions/cache/save@v3
with:
path: |
${{ github.workspace }}/yasm
key: yasm
build:
defaults:
run:
Expand All @@ -56,9 +64,15 @@ jobs:
path: |
${{ github.workspace }}/yasm
key: yasm
- name: add yasm to PATH
- name: Add yasm to PATH
run: echo "${{ github.workspace }}/yasm/bin" >> %GITHUB_PATH%"
- name: CMake
run: cmake -S ports/cmake -B build -DYASM_ASSEMBLER=${{ github.workspace }}/yasm/bin/vsyasm.exe -DBUILD_SHARED_LIBS=${{ matrix.shared }}
- name: CMake --build
- name: Setup vcvars
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- name: Install ninja
uses: turtlesec-no/get-ninja@main
- name: CMake (configure)
run: cmake -S ports/cmake -B build -GNinja -DYASM_ASSEMBLER=${{ github.workspace }}/yasm/bin/vsyasm.exe -DBUILD_SHARED_LIBS=${{ matrix.shared }}
- name: CMake (Build)
run: cmake --build build --verbose

0 comments on commit 667edba

Please sign in to comment.