Skip to content

Commit b6c452b

Browse files
authored
Merge pull request #1 from ZenAlgorithms/ci
Continuous integration added.
2 parents 6714671 + 90a2919 commit b6c452b

File tree

5 files changed

+81
-2
lines changed

5 files changed

+81
-2
lines changed

.github/workflows/tests.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
tests:
8+
runs-on: ubuntu-latest
9+
steps:
10+
-
11+
name: Set up QEMU
12+
uses: docker/setup-qemu-action@v3
13+
-
14+
name: Set up Docker Buildx
15+
uses: docker/setup-buildx-action@v3
16+
-
17+
name: Login to Docker Hub
18+
uses: docker/login-action@v3
19+
with:
20+
username: ${{ secrets.DOCKERHUB_USERNAME }}
21+
password: ${{ secrets.DOCKERHUB_TOKEN }}
22+
-
23+
name: Build and push
24+
uses: docker/build-push-action@v6
25+
with:
26+
push: ${{ github.ref == 'refs/heads/master' }}
27+
tags: iantorres/expressions:latest

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
CMAKE_MINIMUM_REQUIRED(VERSION 3.28)
1+
CMAKE_MINIMUM_REQUIRED(VERSION 3.25)
22
PROJECT(Expressions VERSION 1.0.0 LANGUAGES CXX)
33

44
SET(CMAKE_CXX_STANDARD 23)
55
SET(CMAKE_CXX_STANDARD_REQUIRED True)
66

7-
OPTION(BUILD_TESTS "Build tests" ON)
7+
OPTION(BUILD_TESTS "Build tests" OFF)
88

99
INCLUDE(FetchContent)
1010

Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM iantorres/boosted:amd64-latest
2+
3+
COPY . .
4+
5+
RUN cmake . -DBUILD_TESTS=ON \
6+
&& make \
7+
&& cd bin \
8+
&& ./tests

LICENSE

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
ZenAlgorithms Expressions
2+
Copyright (C) 2024 Ian Torres <[email protected]>
3+
4+
This program is free software: you can redistribute it and/or modify
5+
it under the terms of the GNU Affero General Public License as
6+
published by the Free Software Foundation, either version 3 of the
7+
License, or any later version.
8+
9+
This program is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
GNU Affero General Public License for more details.
13+
14+
You should have received a copy of the GNU Affero General Public License
15+
along with this program. If not, see <https://www.gnu.org/licenses/>.

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Expressions
2+
3+
## Build
4+
5+
```shell
6+
git clone [email protected]:ZenAlgorithms/Expressions.git
7+
cd Expressions
8+
cmake .
9+
make
10+
make install
11+
```
12+
13+
## Usage
14+
15+
```c++
16+
#include <expression/expression.hpp>
17+
18+
using namespace std;
19+
20+
auto it = expression::from_string("/api/servers/{server}/status");
21+
22+
auto result = it->query("/api/servers/production/status");
23+
24+
cout << result->matches() << endl;
25+
// 1
26+
27+
cout << result->bindings()->at("server") << endl;
28+
// production
29+
```

0 commit comments

Comments
 (0)