Add CI for clang-cl (#105)
add GitHub actions to compile with LLVM on Windows (clang-cl) and provide the resulting artifact
This commit is contained in:
+1
-1
@@ -29,7 +29,7 @@ init:
|
|||||||
|
|
||||||
before_build:
|
before_build:
|
||||||
- set VSVERSIONSHORT=%VSVERSION:~3,4%
|
- set VSVERSIONSHORT=%VSVERSION:~3,4%
|
||||||
- if "%APPVEYOR_REPO_TAG_NAME%"=="" ( set "APPVEYOR_REPO_TAG_NAME=dev-vs%VSVERSIONSHORT%-%platform%-%configuration%" )
|
- if "%APPVEYOR_REPO_TAG_NAME%"=="" ( set "APPVEYOR_REPO_TAG_NAME=dev-vs-%VSVERSIONSHORT%-%platform%-%configuration%" )
|
||||||
- mkdir build
|
- mkdir build
|
||||||
- cd build
|
- cd build
|
||||||
- cmake -G "Visual Studio %VSVERSION%" -DCPACK_PACKAGE_VERSION="%APPVEYOR_REPO_TAG_NAME%" %CMAKE_OPTIONS% ..
|
- cmake -G "Visual Studio %VSVERSION%" -DCPACK_PACKAGE_VERSION="%APPVEYOR_REPO_TAG_NAME%" %CMAKE_OPTIONS% ..
|
||||||
|
|||||||
@@ -0,0 +1,61 @@
|
|||||||
|
name: Windows Build with open source compilers
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Windows:
|
||||||
|
runs-on: windows-latest
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
compiler: [clang-cl]
|
||||||
|
build_type: [Release, Debug]
|
||||||
|
fail-fast: false
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: "Clang-cl: Define compiler version"
|
||||||
|
if: matrix.compiler == 'clang-cl'
|
||||||
|
run: |
|
||||||
|
$env:COMPILER_VERSION = "21"
|
||||||
|
Add-Content -Path $env:GITHUB_ENV -Value "COMPILER_VERSION=$env:COMPILER_VERSION"
|
||||||
|
|
||||||
|
- name: "Define package name"
|
||||||
|
run: |
|
||||||
|
$env:VERSION = if ($env:GITHUB_REF -and $env:GITHUB_REF -match "^refs/tags/(?<tag>.+)$") { $matches["tag"] } else { "dev" }
|
||||||
|
$env:PACKAGE_VERSION = "$env:VERSION-${{ matrix.compiler }}-$env:COMPILER_VERSION-x64-${{ matrix.build_type }}"
|
||||||
|
Add-Content -Path $env:GITHUB_ENV -Value "PACKAGE_VERSION=$env:PACKAGE_VERSION"
|
||||||
|
|
||||||
|
- name: "Clang-cl: Set up LLVM"
|
||||||
|
if: matrix.compiler == 'clang-cl'
|
||||||
|
uses: KyleMayes/install-llvm-action@98e68e10c96dffcb7bfed8b2144541a66b49aa02 # v2.0.8
|
||||||
|
with:
|
||||||
|
version: ${{ env.COMPILER_VERSION }}
|
||||||
|
|
||||||
|
- name: Install Ninja
|
||||||
|
run: choco install ninja
|
||||||
|
|
||||||
|
- name: Output environment information
|
||||||
|
run: |
|
||||||
|
cmake --version
|
||||||
|
ninja --version
|
||||||
|
${{ matrix.compiler }} --version
|
||||||
|
|
||||||
|
- name: "Configure CMake"
|
||||||
|
if: matrix.compiler == 'clang-cl'
|
||||||
|
run: |
|
||||||
|
cmake -S . -B build -G "Ninja" -DCMAKE_C_COMPILER=${{ matrix.compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCPACK_PACKAGE_VERSION="$env:PACKAGE_VERSION" -DUSE_STATIC_RUNTIME=ON
|
||||||
|
|
||||||
|
- name: Build with CMake
|
||||||
|
run: cmake --build build --config "${{ matrix.build_type }}"
|
||||||
|
|
||||||
|
- name: Create package
|
||||||
|
run: cmake --build build --target package
|
||||||
|
|
||||||
|
- name: Upload artifacts
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: ${{ env.PACKAGE_VERSION }}
|
||||||
|
path: build/win_flex_bison*.zip
|
||||||
Reference in New Issue
Block a user