summaryrefslogtreecommitdiff
path: root/.github/workflows/tomlplusplus-ci.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/tomlplusplus-ci.yml')
-rw-r--r--.github/workflows/tomlplusplus-ci.yml146
1 files changed, 146 insertions, 0 deletions
diff --git a/.github/workflows/tomlplusplus-ci.yml b/.github/workflows/tomlplusplus-ci.yml
new file mode 100644
index 0000000000..974601fdf9
--- /dev/null
+++ b/.github/workflows/tomlplusplus-ci.yml
@@ -0,0 +1,146 @@
+name: "tomlplusplus: CI"
+
+on:
+ push:
+ paths:
+ - "tomlplusplus/**.h"
+ - "tomlplusplus/**.hpp"
+ - "tomlplusplus/**.cpp"
+ - "tomlplusplus/**.inl"
+ - "tomlplusplus/**.py"
+ - "tomlplusplus/**/meson.build"
+ - ".github/workflows/tomlplusplus-ci.yml"
+ pull_request:
+ paths:
+ - "tomlplusplus/**.h"
+ - "tomlplusplus/**.hpp"
+ - "tomlplusplus/**.cpp"
+ - "tomlplusplus/**.inl"
+ - "tomlplusplus/**.py"
+ - "tomlplusplus/**/meson.build"
+ - ".github/workflows/tomlplusplus-ci.yml"
+ workflow_dispatch:
+
+concurrency:
+ group: tomlplusplus-${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+env:
+ clang_version: "14"
+ gcc_version: "11"
+
+jobs:
+ linux:
+ strategy:
+ fail-fast: false
+ matrix:
+ compiler:
+ - "clang"
+ - "gcc"
+ linker:
+ - "lld"
+ type:
+ - "debug"
+ - "release"
+
+ runs-on: ubuntu-latest
+
+ defaults:
+ run:
+ shell: bash
+ working-directory: tomlplusplus
+
+ steps:
+ - name: Install base dependencies
+ run: |
+ sudo apt -y update
+ sudo apt -y install --no-install-recommends git ninja-build libstdc++-${{ env.gcc_version }}-dev locales-all
+
+ - uses: actions/checkout@v6
+
+ - name: Install python dependencies
+ run: |
+ pip3 install --user --no-cache-dir --upgrade meson
+ pip3 install --user --no-cache-dir --upgrade -r tools/requirements.txt
+
+ - name: Check toml.hpp
+ run: |
+ cd tools
+ python3 ci_single_header_check.py
+
+ - name: Install lld
+ if: ${{ startsWith(matrix.linker, 'lld') }}
+ run: |
+ sudo apt -y install --no-install-recommends lld-${{ env.clang_version }}
+ sudo update-alternatives --install /usr/bin/ld.lld ld.lld /usr/bin/ld.lld-${{ env.clang_version }} 1000
+
+ - name: Install clang
+ if: ${{ startsWith(matrix.compiler, 'clang') }}
+ run: |
+ sudo apt -y install --no-install-recommends clang-${{ env.clang_version }}
+ sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-${{ env.clang_version }} 1000
+ sudo update-alternatives --install /usr/bin/cc cc /usr/bin/clang-${{ env.clang_version }} 1000
+
+ - name: Install gcc
+ if: ${{ startsWith(matrix.compiler, 'gcc') }}
+ run: |
+ sudo apt -y install --no-install-recommends gcc-${{ env.gcc_version }} g++-${{ env.gcc_version }}
+ sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-${{ env.gcc_version }} 1000
+ sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-${{ env.gcc_version }} 1000
+
+ - name: Configure locales
+ run: |
+ sudo locale-gen 'en_US.utf8' 'ja_JP.utf8' 'de_DE.utf8' 'it_IT.utf8' 'tr_TR.utf8' 'fi_FI.utf8' 'fr_FR.utf8' 'zh_CN.utf8'
+
+ - name: Configure Meson
+ run: |
+ CXX=c++ CXX_LD=${{ matrix.linker }} meson setup build --buildtype=${{ matrix.type }} -Ddevel=true -Db_lto=false
+
+ - name: Build
+ run: meson compile -C build
+
+ - name: Test
+ run: meson test -C build --verbose
+
+ windows:
+ strategy:
+ fail-fast: false
+ matrix:
+ type:
+ - "debug"
+ - "release"
+ permissive:
+ - false
+ - true
+ arch:
+ - name: "x64"
+ runner: "windows-2022"
+ - name: "arm64"
+ runner: "windows-11-arm"
+ runs-on: ${{ matrix.arch.runner }}
+
+ defaults:
+ run:
+ shell: cmd
+ working-directory: tomlplusplus
+
+ steps:
+ - name: Install dependencies
+ run: |
+ python3 -m pip install -U pip
+ pip3 install meson ninja
+
+ - uses: actions/checkout@v6
+
+ - uses: ilammy/msvc-dev-cmd@v1
+ with:
+ arch: ${{ matrix.arch.name }}
+
+ - name: Configure Meson
+ run: meson setup build --vsenv --buildtype=${{ matrix.type }} -Ddevel=true -Db_lto=false -Dpermissive=${{ matrix.permissive }}
+
+ - name: Build
+ run: meson compile -C build
+
+ - name: Test
+ run: meson test -C build --verbose