mirror of
https://github.com/YimMenu/YimMenuV2.git
synced 2026-10-10 20:03:17 +08:00
55 lines
1.9 KiB
YAML
55 lines
1.9 KiB
YAML
name: CI
|
|
|
|
on: [ push, pull_request ]
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: [ ubuntu-latest ]
|
|
name: Lint Source
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Check lint with clang-format-21
|
|
run: |
|
|
sudo mkdir -p /etc/apt/keyrings
|
|
curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/llvm-snapshot.gpg
|
|
sudo chmod a+r /etc/apt/keyrings/llvm-snapshot.gpg
|
|
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/llvm-snapshot.gpg] http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/llvm.list > /dev/null
|
|
sudo apt-get update && sudo apt-get install -y clang-format-21
|
|
clang-format-21 --version
|
|
find src \( -name "*.hpp" -o -name "*.h" -o -name "*.cpp" \) -exec clang-format-21 --Werror --dry-run --verbose {} +
|
|
|
|
ci:
|
|
runs-on: [ self-hosted, Windows ]
|
|
name: CI
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Check CMake version
|
|
run: cmake --version
|
|
|
|
- name: Setup MSVC environment
|
|
uses: ilammy/msvc-dev-cmd@v1
|
|
with:
|
|
arch: amd64
|
|
|
|
- name: Generate CMake project
|
|
run: cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=RelWithDebInfo -S . -B build -G Ninja
|
|
|
|
- name: Build 64bit RelWithDebInfo DLL
|
|
run: cmake --build ./build --config RelWithDebInfo --target YimMenuV2 --
|
|
|
|
- name: Check if DLL got built
|
|
run: if (-Not (Test-Path -path "build/YimMenuV2.dll")) {throw 1}
|
|
|
|
- name: Rename DLL to YimMenuV2-dev-{GITHUB_SHA}.dll
|
|
run: |
|
|
del YimMenuV2-dev-*.dll
|
|
ren YimMenuV2.dll YimMenuV2-dev-${{github.sha}}.dll
|
|
working-directory: build/
|
|
|
|
- name: Upload Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: RelWithDebInfo-Clang
|
|
path: build/YimMenuV2-dev-*.dll |