Skip to content

Commit

Permalink
Automate test with GitHub Actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
stripe2933 committed Nov 22, 2023
1 parent 26479d7 commit 5ce629f
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 7 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/clang.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test with Clang 17

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: 17

- name: Install CMake and Ninja
uses: lukka/get-cmake@latest

- name: Build project
run: |
mkdir build
cmake -S . -B build -G Ninja \
-DCMAKE_CXX_COMPILER=${{ env.LLVM_PATH }}/bin/clang++ \
-DCMAKE_BUILD_TYPE=Release
ninja -C build
- name: Run tests
run: |
cd build
./mdspan_formatter_test
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# mdspan_formatter

![Build with Clang](https://github.com/stripe2933/mdspan_formatter/actions/workflows/clang.yml/badge.svg)

Make `std::mdspan` (multi-dimensional span; currently [`Kokkos::mdspan`](https://github.com/kokkos/mdspan)) formattable using `std::format` or [`fmt::format`](https://github.com/fmtlib/fmt).

## Usage
Expand Down Expand Up @@ -86,9 +89,9 @@ Note that it only supports `mdspan` with `default_accessor` accessor.
```cmake
include(FetchContent)
FetchContent_Declare(
mdspan_formatter
GIT_REPOSITORY https://github.com/stripe2933/mdspan_formatter.git
GIT_TAG main
mdspan_formatter
GIT_REPOSITORY https://github.com/stripe2933/mdspan_formatter.git
GIT_TAG main
)
FetchContent_MakeAvailable(mdspan_formatter)
Expand All @@ -102,9 +105,8 @@ GCC and MSVC are not tested yet.

For use library with fmt, Clang ≥ 11.0.0 and GCC ≥ 10.2 with std ≥ c++20 condition are tested. MSVC is not tested yet.
[Try on Compiler Explorer](https://godbolt.org/z/1sTd18Gxs).

****
First, you need [Kokkos's mdspan](https://github.com/kokkos/mdspan), which is reference implementation of `std::mdspan` because none of compiler
implemented mdspan at now.
implemented submdspan at now.

If you want to build the test, download the repository and build CMake project. Note that μt, fmt and Kokkos mdspan library should be found using
`find_package` command.
If you want to build the test, download the repository and build CMake project.

0 comments on commit 5ce629f

Please sign in to comment.