2022-02-12 13:28:19 +00:00
|
|
|
name: ci
|
|
|
|
|
2022-04-22 20:27:11 +00:00
|
|
|
on:
|
|
|
|
push:
|
2022-06-06 20:46:04 +00:00
|
|
|
branches-ignore:
|
|
|
|
- 'gh-pages'
|
2022-04-22 20:27:11 +00:00
|
|
|
paths:
|
|
|
|
- '**.h'
|
|
|
|
- '**.hpp'
|
|
|
|
- '**.cpp'
|
|
|
|
- '**.inl'
|
|
|
|
- '**.py'
|
|
|
|
- '**/meson.build'
|
2022-04-23 09:58:15 +00:00
|
|
|
- '**/workflows/**.yaml'
|
2022-04-22 20:27:11 +00:00
|
|
|
pull_request:
|
2022-06-06 20:46:04 +00:00
|
|
|
branches-ignore:
|
|
|
|
- 'gh-pages'
|
2022-04-22 20:27:11 +00:00
|
|
|
paths:
|
|
|
|
- '**.h'
|
|
|
|
- '**.hpp'
|
|
|
|
- '**.cpp'
|
|
|
|
- '**.inl'
|
|
|
|
- '**.py'
|
|
|
|
- '**/meson.build'
|
2022-04-23 09:58:15 +00:00
|
|
|
- '**/workflows/**.yaml'
|
2022-04-22 20:27:11 +00:00
|
|
|
workflow_dispatch:
|
|
|
|
|
2022-02-12 13:28:19 +00:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2022-07-31 12:47:42 +00:00
|
|
|
env:
|
|
|
|
clang_version: '14'
|
|
|
|
gcc_version: '11'
|
|
|
|
|
2022-02-12 13:28:19 +00:00
|
|
|
jobs:
|
|
|
|
linux:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2022-05-08 21:18:19 +00:00
|
|
|
compiler:
|
|
|
|
- 'clang++'
|
|
|
|
- 'g++'
|
|
|
|
linker:
|
|
|
|
- 'lld'
|
|
|
|
type:
|
|
|
|
- 'debug'
|
|
|
|
- 'release'
|
|
|
|
compile_library:
|
|
|
|
- 'true'
|
|
|
|
- 'false'
|
2022-02-12 13:28:19 +00:00
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
2022-07-31 12:47:42 +00:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
2022-02-12 13:28:19 +00:00
|
|
|
steps:
|
2022-07-31 12:47:42 +00:00
|
|
|
- name: Install base dependencies
|
2022-02-12 13:28:19 +00:00
|
|
|
run: |
|
2022-05-08 21:18:19 +00:00
|
|
|
sudo apt -y update
|
2022-08-14 13:11:15 +00:00
|
|
|
sudo apt -y install --no-install-recommends git python3 python3-pip ninja-build locales-all
|
2022-07-31 12:47:42 +00:00
|
|
|
sudo -H pip3 install --no-cache-dir --upgrade meson
|
2022-02-12 13:28:19 +00:00
|
|
|
|
2022-05-08 21:18:19 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-02-12 13:28:19 +00:00
|
|
|
|
|
|
|
- name: Check toml.hpp
|
|
|
|
run: |
|
|
|
|
cd tools
|
2022-07-31 12:47:42 +00:00
|
|
|
sudo -H pip3 install --upgrade --requirement ./requirements.txt
|
2022-05-08 21:18:19 +00:00
|
|
|
python3 ci_single_header_check.py
|
2022-02-12 13:28:19 +00:00
|
|
|
|
2022-07-31 12:47:42 +00:00
|
|
|
- name: Update LLVM package repository
|
|
|
|
if: ${{ startsWith(matrix.compiler, 'clang') || startsWith(matrix.linker, 'lld') }}
|
|
|
|
run: |
|
|
|
|
sudo apt -y install --no-install-recommends software-properties-common wget
|
|
|
|
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
|
|
|
codename=$(lsb_release -sc)
|
|
|
|
sudo add-apt-repository --yes --no-update "deb http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-${{ env.clang_version }} main"
|
|
|
|
sudo apt -y update
|
|
|
|
|
|
|
|
- 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/clang++ clang++ /usr/bin/clang++-${{ env.clang_version }} 1000
|
|
|
|
|
|
|
|
- name: Install g++
|
|
|
|
if: ${{ startsWith(matrix.compiler, 'g++') }}
|
|
|
|
run: |
|
|
|
|
sudo apt -y install --no-install-recommends g++-${{ env.gcc_version }}
|
|
|
|
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${{ env.gcc_version }} 1000
|
|
|
|
|
|
|
|
- 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: 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'
|
|
|
|
|
2022-02-12 13:28:19 +00:00
|
|
|
- name: Configure Meson
|
|
|
|
run: |
|
2022-05-08 21:18:19 +00:00
|
|
|
CXX=${{ matrix.compiler }} CXX_LD=${{ matrix.linker }} meson setup build --buildtype=${{ matrix.type }} -Dcompile_library=${{ matrix.compile_library }} -Dpedantic=true -Dbuild_tests=true -Dbuild_examples=true -Dgenerate_cmake_config=false -Db_lto=false -Dubsan_examples=true -Dasan_examples=true
|
2022-02-12 13:28:19 +00:00
|
|
|
|
|
|
|
- name: Build
|
2022-04-18 09:27:54 +00:00
|
|
|
run: meson compile -C build --jobs -1
|
2022-02-12 13:28:19 +00:00
|
|
|
|
|
|
|
- name: Test
|
|
|
|
run: meson test -C build --verbose
|
|
|
|
|
|
|
|
windows:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2022-05-08 21:18:19 +00:00
|
|
|
type:
|
|
|
|
- 'debug'
|
|
|
|
- 'release'
|
|
|
|
compile_library:
|
|
|
|
- 'true'
|
|
|
|
# - 'false' # ... header-only mode takes far too long on github's windows runner
|
2022-02-12 13:28:19 +00:00
|
|
|
|
|
|
|
runs-on: windows-2022
|
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: cmd
|
|
|
|
|
|
|
|
steps:
|
2022-02-14 17:29:09 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2022-10-17 17:08:26 +00:00
|
|
|
python3 -m pip install -U pip
|
2022-02-14 17:29:09 +00:00
|
|
|
pip3 install meson ninja
|
|
|
|
|
2022-07-31 12:47:42 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-02-14 17:29:09 +00:00
|
|
|
|
|
|
|
- uses: ilammy/msvc-dev-cmd@v1
|
|
|
|
|
|
|
|
- name: Configure Meson
|
2022-04-18 09:47:05 +00:00
|
|
|
run: meson setup --vsenv --buildtype=${{ matrix.type }} -Dcompile_library=${{ matrix.compile_library }} -Dpedantic=true -Dbuild_tests=true -Dbuild_examples=true -Dgenerate_cmake_config=false build
|
2022-02-14 17:29:09 +00:00
|
|
|
|
|
|
|
- name: Build
|
2022-04-18 09:27:54 +00:00
|
|
|
run: meson compile -C build --jobs -1
|
2022-02-14 17:29:09 +00:00
|
|
|
|
|
|
|
- name: Test
|
|
|
|
run: meson test -C build --verbose
|
2022-04-29 12:54:50 +00:00
|
|
|
|
2022-10-14 10:29:12 +00:00
|
|
|
# tipi-build-linux:
|
|
|
|
# name: tipi.build project build and dependency resolution
|
|
|
|
# runs-on: ubuntu-latest
|
|
|
|
# if: github.ref == 'refs/heads/master'
|
|
|
|
# container: tipibuild/tipi-ubuntu
|
|
|
|
#
|
|
|
|
# env:
|
|
|
|
# HOME: /root
|
|
|
|
#
|
|
|
|
# steps:
|
|
|
|
# - uses: actions/checkout@v3
|
|
|
|
# - run: mkdir -p ~/.tipi
|
|
|
|
#
|
|
|
|
# # checking if the tomlplusplus project builds and passes tests
|
|
|
|
# - name: Build as project target linux-cxx17 (run tests 'odr_test_1' and 'main')
|
|
|
|
# run: tipi . --dont-upgrade --verbose -t linux-cxx17 --test "odr_test_1|main"
|
|
|
|
#
|
|
|
|
# - name: Build as project target linux-cxx20 (run tests 'odr_test_1' and 'main')
|
|
|
|
# run: tipi . --dont-upgrade --verbose -t linux-cxx20 --test "odr_test_1|main"
|
|
|
|
#
|
|
|
|
# - name: Cleanup project builds
|
|
|
|
# run: rm -r ./build
|
|
|
|
#
|
|
|
|
# - name: "Get branch name and save to env"
|
|
|
|
# env:
|
|
|
|
# IS_PR: ${{ github.EVENT_NAME == 'pull_request' }}
|
|
|
|
# run: |
|
|
|
|
# if ${IS_PR}; then
|
|
|
|
# BRANCH_NAME="${GITHUB_HEAD_REF}"
|
|
|
|
# else
|
|
|
|
# BRANCH_NAME="${GITHUB_REF##*/}"
|
|
|
|
# fi
|
|
|
|
# echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV
|
|
|
|
#
|
|
|
|
# # trying if pulling the dependency with tipi works properly
|
|
|
|
# - name: Build as dependency
|
|
|
|
# run: |
|
|
|
|
# cd examples/
|
|
|
|
#
|
|
|
|
# # create test directory and copy the simple_parser.cpp in there
|
|
|
|
# mkdir test-as-dep
|
|
|
|
# cp examples.h test-as-dep/.
|
|
|
|
# cp simple_parser.cpp test-as-dep/.
|
|
|
|
# cd test-as-dep/
|
|
|
|
#
|
|
|
|
# # create a deps file referencing the commit that triggered this build as dependency
|
|
|
|
# mkdir .tipi
|
|
|
|
# echo '{ "requires": { "${{ github.event.repository.full_name }}": { "@": "${{ env.BRANCH_NAME }}" } } }' > .tipi/deps
|
|
|
|
#
|
|
|
|
# # build
|
|
|
|
# tipi . --dont-upgrade --verbose -t linux-cxx17
|
|
|
|
# ./build/linux-cxx17/bin/simple_parser ../example.toml
|