Skip to content

Commit

Permalink
tipi.build support for tomlplusplus (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
pysco68 authored Apr 29, 2022
1 parent 25058a0 commit 1c09239
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,56 @@ jobs:

- name: Test
run: meson test -C build --verbose


tipi-build-linux:
name: tipi.build project build and dependency resolution
runs-on: ubuntu-latest
container: tipibuild/tipi-ubuntu

env:
HOME: /root

steps:
- uses: actions/checkout@v2
- 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
7 changes: 7 additions & 0 deletions .tipi/deps
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"x": ["/external"],
"requires": {
"tipi-deps/Catch2@file://single_include": { "@": "v2.x" },
"nlohmann/json": { "@": "v3.10.5" }
}
}
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,17 @@ depends: [
```
> ℹ️ _[What is DDS?](https://dds.pizza/)_
### Tipi.build
`tomlplusplus` can be easily used in [tipi.build](https://tipi.build) projects by adding the following entry to your `.tipi/deps`:
```json
{
"marzer/tomlplusplus": { }
}
```

### Vcpkg
```
vcpkg install tomlplusplus
Expand Down
8 changes: 8 additions & 0 deletions docs/pages/main_page.dox
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,15 @@ tomlplusplus_dep = dependency('tomlplusplus')

You can also add it as a subproject directly.

\subsection mainpage-adding-lib-tipi Tipi.build

`tomlplusplus` can be easily used in [tipi.build](https://tipi.build) projects by adding the following entry to your `.tipi/deps`:

\bash
{
"marzer/tomlplusplus": { }
}
\ebash

\subsection mainpage-adding-lib-vcpkg Vcpkg
\bash
Expand Down

0 comments on commit 1c09239

Please sign in to comment.