diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7855847 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,46 @@ +name: CI + +on: + push: + branches: + - ci + pull_request: + branches: + - ci + +jobs: + gcc-linux: + runs-on: ubuntu-latest + container: + image: ghcr.io/ednolan/ubuntu24.10_gcc14.2.0 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Run + run: | + ./ci.sh -fsanitize=address -fsanitize=undefined -fsanitize-undefined-trap-on-error + clang-linux: + runs-on: ubuntu-latest + container: + image: ghcr.io/ednolan/ubuntu24.10_clang19.1.0rc2 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Run + run: | + ./ci.sh -fsanitize=address -fsanitize=undefined -fsanitize-undefined-trap-on-error -stdlib=libc++ -Wno-unqualified-std-cast-call + msvc-windows: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Run + shell: bash + run: | + ./ci.sh diff --git a/ci.sh b/ci.sh new file mode 100755 index 0000000..02407a5 --- /dev/null +++ b/ci.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +set -euo pipefail + +function main() { + local -a cxx_flags=("$@") + local checkout="$PWD" + mkdir "$checkout/build" + cd "$checkout/build" + cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_STANDARD=23 -DBUILD_TESTING=On -DCMAKE_CXX_FLAGS="${cxx_flags[*]}" + cmake --build . --parallel + if [[ -d "$checkout/build/Debug" ]] ; then # windows + ctest -C Debug + else + ctest + fi +} + +main "$@" diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..05b7949 --- /dev/null +++ b/readme.md @@ -0,0 +1 @@ +[![CI](https://github.com/ednolan/utfview/actions/workflows/ci.yml/badge.svg)](https://github.com/ednolan/utfview/actions)