Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 94 additions & 58 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,68 +3,140 @@ name: ci
on:
push:
branches: [main]
tags: ['v*']
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup prerequisites
run: |
sudo apt-get update
sudo apt-get install -y ninja-build xorg-dev libxi-dev libxrandr-dev libxinerama-dev libxcursor-dev libx11-dev libxext-dev libasound2-dev libgtk-3-dev clang-tidy
- name: Configure
run: cmake --preset linux
- name: clang-tidy
run: run-clang-tidy -p build/linux
Comment on lines +9 to +20

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Ensure lint job installs tools and compile commands for clang-tidy

The lint workflow invokes run-clang-tidy -p build/linux right after configuration, but the job only installs the clang-tidy package and never generates a compile_commands.json. On ubuntu runners run-clang-tidy is provided by the clang-tools package, so this step will fail before running any checks, and even if the script were present it would abort because no compilation database exists in build/linux. The job will therefore fail on every run. Consider installing clang-tools (or llvm) and enabling CMAKE_EXPORT_COMPILE_COMMANDS=ON or performing a build before calling run-clang-tidy.

Useful? React with 👍 / 👎.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codex fix comments

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

  • Ensure the lint workflow installs clang-tools so run-clang-tidy is available and generate compile_commands.json by exporting compile commands during configuration .github/workflows/ci.ymlL13-L20

Testing

  • ⚠️ actionlint .github/workflows/ci.yml (command not found: actionlint)
  • ⚠️ cmake --preset linux -DLIZARD_EMBED_ASSETS=ON (gtk+-3.0 not found)

View task →


format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install clang-format
run: |
sudo apt-get update
sudo apt-get install -y clang-format
- name: Check formatting
run: |
clang-format --version
clang-format --dry-run --Werror $(git ls-files '*.cpp' '*.hpp' '*.c' '*.h')

typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup prerequisites
run: |
sudo apt-get update
sudo apt-get install -y ninja-build xorg-dev libxi-dev libxrandr-dev libxinerama-dev libxcursor-dev libx11-dev libxext-dev libasound2-dev libgtk-3-dev
- name: Configure
run: cmake --preset linux -DLIZARD_EMBED_ASSETS=ON
- name: Build (type check)
run: cmake --build build/linux --config Release --target LizardHook

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup prerequisites
run: |
sudo apt-get update
sudo apt-get install -y ninja-build xorg-dev libxi-dev libxrandr-dev libxinerama-dev libxcursor-dev libx11-dev libxext-dev libasound2-dev libgtk-3-dev
- name: Configure
run: cmake --preset linux -DLIZARD_EMBED_ASSETS=ON
- name: Build
run: cmake --build build/linux --config Release
- name: Test
run: ctest --test-dir build/linux --output-on-failure

build:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }}-${{ matrix.arch }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
- runner: ubuntu-latest
os: linux
arch: x64
preset: linux
artifact: LizardHook-linux-x64.tar.gz
ext: tar.gz
- os: macos-latest
configure_args: ""
- runner: ubuntu-24.04-arm
os: linux
arch: arm64
preset: linux
artifact: LizardHook-linux-arm64.tar.gz
ext: tar.gz
configure_args: ""
- runner: macos-latest
os: macos
arch: x64
preset: macos
artifact: LizardHook-macos-x64.zip
ext: zip
configure_args: "-DCMAKE_OSX_ARCHITECTURES=x86_64"
- runner: macos-latest
os: macos
arch: arm64
preset: macos
artifact: LizardHook-macos.zip
artifact: LizardHook-macos-arm64.zip
ext: zip
- os: windows-latest
configure_args: "-DCMAKE_OSX_ARCHITECTURES=arm64"
- runner: windows-latest
os: windows
arch: x64
preset: win-mingw
artifact: LizardHook-win-x64.zip
ext: zip
configure_args: ""
steps:
- uses: actions/checkout@v4

- name: Setup prerequisites (Linux)
if: matrix.os == 'ubuntu-latest'
if: matrix.os == 'linux'
run: |
sudo apt-get update
sudo apt-get install -y ninja-build xorg-dev libxi-dev libxrandr-dev libxinerama-dev libxcursor-dev libx11-dev libxext-dev libasound2-dev libgtk-3-dev

- name: Setup prerequisites (macOS)
if: matrix.os == 'macos-latest'
if: matrix.runner == 'macos-latest'
run: brew install ninja || true

- name: Setup MinGW (Windows)
if: matrix.os == 'windows-latest'
if: matrix.runner == 'windows-latest'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
install: mingw-w64-x86_64-gcc mingw-w64-x86_64-ninja

- name: Configure
run: cmake --preset ${{ matrix.preset }} -DLIZARD_EMBED_ASSETS=ON
run: cmake --preset ${{ matrix.preset }} -DLIZARD_EMBED_ASSETS=ON ${{ matrix.configure_args }}
shell: bash

- name: Build
run: cmake --build build/${{ matrix.preset }} --config Release
shell: bash

- name: Test
run: ctest --test-dir build/${{ matrix.preset }} --output-on-failure
shell: bash

- name: Install
run: cmake --install build/${{ matrix.preset }} --prefix install/${{ matrix.preset }}
run: cmake --install build/${{ matrix.preset }} --prefix install/${{ matrix.preset }}-${{ matrix.arch }}
shell: bash

- name: Package
run: |
cd install/${{ matrix.preset }}
cd install/${{ matrix.preset }}-${{ matrix.arch }}
if [ "${{ matrix.ext }}" = "tar.gz" ]; then
tar czf ../../${{ matrix.artifact }} *
else
Expand All @@ -74,12 +146,12 @@ jobs:

- name: Verify linkage
run: |
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
ldd install/${{ matrix.preset }}/LizardHook || true
elif [ "${{ matrix.os }}" = "macos-latest" ]; then
otool -L install/${{ matrix.preset }}/LizardHook || true
if [ "${{ matrix.os }}" = "linux" ]; then
ldd install/${{ matrix.preset }}-${{ matrix.arch }}/LizardHook || true
elif [ "${{ matrix.os }}" = "macos" ]; then
otool -L install/${{ matrix.preset }}-${{ matrix.arch }}/LizardHook || true
else
dumpbin /DEPENDENTS install/${{ matrix.preset }}/LizardHook.exe || true
dumpbin /DEPENDENTS install/${{ matrix.preset }}-${{ matrix.arch }}/LizardHook.exe || true
fi
shell: bash

Expand All @@ -88,39 +160,3 @@ jobs:
name: ${{ matrix.artifact }}
path: ${{ matrix.artifact }}

release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Read version
id: ver
run: echo "version=$(cat VERSION)" >> "$GITHUB_OUTPUT"

- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: LizardHook-*
path: dist
merge-multiple: true

- name: Generate changelog
run: |
prev_tag=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
git log ${prev_tag}..HEAD --pretty=format:'- %s' > changelog.md

- name: Create release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.ver.outputs.version }}
name: Lizard Hook v${{ steps.ver.outputs.version }}
body_path: changelog.md
files: |
dist/LizardHook-win-x64.zip
dist/LizardHook-macos.zip
dist/LizardHook-linux-x64.tar.gz

133 changes: 133 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
name: release

on:
push:
tags: ['v*']

jobs:
build:
name: ${{ matrix.os }}-${{ matrix.arch }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-latest
os: linux
arch: x64
preset: linux
artifact: LizardHook-linux-x64.tar.gz
ext: tar.gz
configure_args: ""
- runner: ubuntu-24.04-arm
os: linux
arch: arm64
preset: linux
artifact: LizardHook-linux-arm64.tar.gz
ext: tar.gz
configure_args: ""
- runner: macos-latest
os: macos
arch: x64
preset: macos
artifact: LizardHook-macos-x64.zip
ext: zip
configure_args: "-DCMAKE_OSX_ARCHITECTURES=x86_64"
- runner: macos-latest
os: macos
arch: arm64
preset: macos
artifact: LizardHook-macos-arm64.zip
ext: zip
configure_args: "-DCMAKE_OSX_ARCHITECTURES=arm64"
- runner: windows-latest
os: windows
arch: x64
preset: win-mingw
artifact: LizardHook-win-x64.zip
ext: zip
configure_args: ""
steps:
- uses: actions/checkout@v4

- name: Setup prerequisites (Linux)
if: matrix.os == 'linux'
run: |
sudo apt-get update
sudo apt-get install -y ninja-build xorg-dev libxi-dev libxrandr-dev libxinerama-dev libxcursor-dev libx11-dev libxext-dev libasound2-dev libgtk-3-dev

- name: Setup prerequisites (macOS)
if: matrix.runner == 'macos-latest'
run: brew install ninja || true

- name: Setup MinGW (Windows)
if: matrix.runner == 'windows-latest'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
install: mingw-w64-x86_64-gcc mingw-w64-x86_64-ninja

- name: Configure
run: cmake --preset ${{ matrix.preset }} -DLIZARD_EMBED_ASSETS=ON ${{ matrix.configure_args }}
shell: bash

- name: Build
run: cmake --build build/${{ matrix.preset }} --config Release
shell: bash

- name: Install
run: cmake --install build/${{ matrix.preset }} --prefix install/${{ matrix.preset }}-${{ matrix.arch }}
shell: bash

- name: Package
run: |
cd install/${{ matrix.preset }}-${{ matrix.arch }}
if [ "${{ matrix.ext }}" = "tar.gz" ]; then
tar czf ../../${{ matrix.artifact }} *
else
zip -r ../../${{ matrix.artifact }} *
fi
shell: bash

- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: ${{ matrix.artifact }}

release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Read version
id: ver
run: echo "version=$(cat VERSION)" >> "$GITHUB_OUTPUT"

- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: LizardHook-*
path: dist
merge-multiple: true

- name: Generate changelog
run: |
prev_tag=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
git log ${prev_tag}..HEAD --pretty=format:'- %s' > changelog.md

- name: Create release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.ver.outputs.version }}
name: Lizard Hook v${{ steps.ver.outputs.version }}
body_path: changelog.md
files: |
dist/LizardHook-win-x64.zip
dist/LizardHook-macos-x64.zip
dist/LizardHook-macos-arm64.zip
dist/LizardHook-linux-x64.tar.gz
dist/LizardHook-linux-arm64.tar.gz

Loading