Skip to content

Improve EvalString #404

Improve EvalString

Improve EvalString #404

Workflow file for this run

name: CI
on:
push:
branches: ["main"]
tags:
- "v*.*.*"
pull_request:
branches: ["main"]
jobs:
build:
strategy:
fail-fast: false
matrix:
environment: [
{name: Linux, os: ubuntu-20.04, cpp: clang++-12, c: clang-12},
{name: MacOS, os: macos-13, cpp: clang++, c: clang},
{name: Windows, os: windows-latest, cpp: cl, c: cl},
]
build_type: [Debug, Release]
name: ${{ matrix.environment.name }} (${{ matrix.build_type }})
runs-on: ${{ matrix.environment.os }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Configure CMake
run: >
cmake -B output
-DCMAKE_CXX_COMPILER=${{ matrix.environment.cpp }}
-DCMAKE_C_COMPILER=${{ matrix.environment.c }}
${{ format('-D{0}={1}', matrix.environment.name == 'Windows' && 'CMAKE_CONFIGURATION_TYPES' || 'CMAKE_BUILD_TYPE', matrix.build_type) }}
${{ matrix.environment.name != 'Windows' && '-G Ninja' || ''}}
- uses: elliotgoodrich/trimja-action@v1
# Skip Windows (which doesn't yet use Ninja) and releases
if: matrix.environment.name != 'Windows' && !startsWith(github.ref, 'refs/tags/')
with:
path: output/build.ninja
build-configuration: ${{ matrix.build_type }}
# CTest does not have the right dependencies so we always build everything, we
# won't gain any time, but will verify that trimja can at least handle a Ninja
# file generated by CMake.
affected: |
test
trimja
- name: Build
run: cmake --build output --config ${{ matrix.build_type }}
- name: Test
run: ctest --test-dir output --build-config ${{ matrix.build_type }} --output-on-failure
- name: Install
if: startsWith(github.ref, 'refs/tags/') && matrix.build_type == 'Release'
run: cmake --build output --config ${{ matrix.build_type }} --target package
- name: Generate Changelog
run: git show -s --format='%b' > build/CHANGELOG.txt
if: startsWith(github.ref, 'refs/tags/') && matrix.build_type == 'Release'
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/') && matrix.build_type == 'Release'
with:
body_path: build/CHANGELOG.txt
files: |
build/trimja-*-Linux.tar.gz
build/trimja-*-Darwin.tar.gz
build/trimja-*-win64.exe
build/trimja-*.zip
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run clang-format
uses: jidicula/clang-format-action@v4.13.0
with:
clang-format-version: '17'
check-path: 'src'