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
105 changes: 105 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: CI

on:
workflow_dispatch:
push:
paths:
- "include/**"
- "examples/**"
- "tests/**"
- "cmake/**"
- "CMakeLists.txt"
- "CMakePresets.json"
- ".github/workflows/ci.yml"
pull_request:
paths:
- "include/**"
- "examples/**"
- "tests/**"
- "cmake/**"
- "CMakeLists.txt"
- "CMakePresets.json"
- ".github/workflows/ci.yml"

permissions:
contents: read

concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-and-test:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
timeout-minutes: 20

strategy:
fail-fast: false
matrix:
include:
- name: Windows / MSVC
os: windows-latest
build_type: Release
cmake_args: ""
build_examples: "ON"
sanitizers: "OFF"
- name: macOS / AppleClang
os: macos-latest
build_type: Release
cmake_args: "-DCMAKE_C_COMPILER=clang"
build_examples: "ON"
sanitizers: "OFF"
- name: Linux / GCC
os: ubuntu-latest
build_type: Release
cmake_args: "-DCMAKE_C_COMPILER=gcc"
build_examples: "ON"
sanitizers: "OFF"
- name: Linux / Clang / ASan+UBSan
os: ubuntu-latest
build_type: Debug
cmake_args: "-DCMAKE_C_COMPILER=clang"
build_examples: "OFF"
sanitizers: "ON"

steps:
- name: Checkout
uses: actions/checkout@v7

- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends \
libasound2-dev \
libgl1-mesa-dev \
libglu1-mesa-dev \
libx11-dev \
libxcursor-dev \
libxext-dev \
libxfixes-dev \
libxi-dev \
libxinerama-dev \
libxrandr-dev \
libwayland-dev \
libxkbcommon-dev

- name: Configure
run: >-
cmake -S . -B build
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DRTEXTJP_FETCH_RAYLIB=ON
-DRTEXTJP_BUILD_EXAMPLES=${{ matrix.build_examples }}
-DRTEXTJP_BUILD_TESTS=ON
-DRTEXTJP_BUILD_DOCS_GALLERY=OFF
-DRTEXTJP_BUILD_DEMO_PACKAGE=OFF
-DRTEXTJP_ENABLE_SANITIZERS=${{ matrix.sanitizers }}
-DBUILD_SHARED_LIBS=OFF
${{ matrix.cmake_args }}

- name: Build
run: cmake --build build --config ${{ matrix.build_type }} --parallel 2

- name: Test
run: ctest --test-dir build --build-config ${{ matrix.build_type }} --output-on-failure
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<img alt="Language: C99" src="https://img.shields.io/badge/language-C99-A8B9CC?style=flat-square&logo=c&logoColor=white">
<img alt="C++ compatible header" src="https://img.shields.io/badge/C%2B%2B-header%20compatible-00599C?style=flat-square&logo=cplusplus&logoColor=white">
<img alt="Single header" src="https://img.shields.io/badge/distribution-single--header-6E40C9?style=flat-square">
<a href="https://github.com/LuisR385/rtextJP/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/LuisR385/rtextJP/actions/workflows/ci.yml/badge.svg"></a>
<a href="https://github.com/raysan5/raylib"><img alt="raylib 6.0 or later" src="https://img.shields.io/badge/raylib-6.0%2B-000000?style=flat-square&logo=raylib&logoColor=white"></a>
<img alt="Platforms: Windows, Linux, macOS" src="https://img.shields.io/badge/platform-Windows%20%7C%20Linux%20%7C%20macOS-2F80ED?style=flat-square">
<img alt="Build: CMake 3.22 or later" src="https://img.shields.io/badge/CMake-3.22%2B-064F8C?style=flat-square&logo=cmake&logoColor=white">
Expand Down
1 change: 1 addition & 0 deletions README_ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<img alt="言語: C99" src="https://img.shields.io/badge/language-C99-A8B9CC?style=flat-square&logo=c&logoColor=white">
<img alt="C++から利用可能" src="https://img.shields.io/badge/C%2B%2B-header%20compatible-00599C?style=flat-square&logo=cplusplus&logoColor=white">
<img alt="シングルヘッダー" src="https://img.shields.io/badge/distribution-single--header-6E40C9?style=flat-square">
<a href="https://github.com/LuisR385/rtextJP/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/LuisR385/rtextJP/actions/workflows/ci.yml/badge.svg"></a>
<a href="https://github.com/raysan5/raylib"><img alt="raylib 6.0以降" src="https://img.shields.io/badge/raylib-6.0%2B-000000?style=flat-square&logo=raylib&logoColor=white"></a>
<img alt="対応環境: Windows, Linux, macOS" src="https://img.shields.io/badge/platform-Windows%20%7C%20Linux%20%7C%20macOS-2F80ED?style=flat-square">
<img alt="CMake 3.22以降" src="https://img.shields.io/badge/CMake-3.22%2B-064F8C?style=flat-square&logo=cmake&logoColor=white">
Expand Down