Skip to content

Commit 2957c5e

Browse files
authored
Moving functions from faasm (#31)
* Adding functions * Libfake task * Update usage instructions * Add test for wasm compilation * Version * Formatting
1 parent ae8c115 commit 2957c5e

File tree

206 files changed

+10928
-1877
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+10928
-1877
lines changed

.clang-format

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
BasedOnStyle: Mozilla
3+
4+
---
5+
Language: Cpp
6+
7+
# Avoid excessive linebreaks on function definitions
8+
AlwaysBreakAfterDefinitionReturnType: None
9+
AlwaysBreakAfterReturnType: None
10+
11+
IndentWidth: 4
12+
DerivePointerAlignment: false
13+
---

.clang-tidy

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
Checks: 'readability-braces-around-statements,\
3+
modernize-use-auto,\
4+
-clang-diagnostic-unknown-attributes,\
5+
-clang-diagnostic-return-type'
6+
CheckOptions:
7+
}

.env

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
SYSROOT_VERSION=0.0.21
2-
SYSROOT_CLI_IMAGE=faasm/cpp-sysroot:0.0.21
1+
SYSROOT_VERSION=0.0.22
2+
SYSROOT_CLI_IMAGE=faasm/cpp-sysroot:0.0.22
33
COMPOSE_PROJECT_NAME=cpp-dev

.github/workflows/tests.yml

+23-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
if: github.event.pull_request.draft == false
1313
runs-on: ubuntu-20.04
1414
container:
15-
image: faasm/cpp-sysroot:0.0.21
15+
image: faasm/cpp-sysroot:0.0.22
1616
defaults:
1717
run:
1818
working-directory: /code/cpp
@@ -44,7 +44,7 @@ jobs:
4444
REDIS_QUEUE_HOST: redis
4545
REDIS_STATE_HOST: redis
4646
container:
47-
image: faasm/cpp-sysroot:0.0.21
47+
image: faasm/cpp-sysroot:0.0.22
4848
defaults:
4949
run:
5050
working-directory: /code/cpp
@@ -65,6 +65,26 @@ jobs:
6565
- name: "Run the tests"
6666
run: /build/cpp/static/bin/tests
6767

68+
wasm:
69+
if: github.event.pull_request.draft == false
70+
runs-on: ubuntu-20.04
71+
env:
72+
HOST_TYPE: ci
73+
container:
74+
image: faasm/cpp-sysroot:0.0.22
75+
defaults:
76+
run:
77+
working-directory: /code/cpp
78+
steps:
79+
- name: "Fetch ref"
80+
run: git fetch origin ${GITHUB_REF}:ci-branch
81+
- name: "Check out branch"
82+
run: git checkout --force ci-branch
83+
- name: "Build the functions to check doesn't error"
84+
run: inv func.local
85+
- name: "Build libfake to check doesn't error"
86+
run: inv libfake
87+
6888
examples:
6989
if: github.event.pull_request.draft == false
7090
runs-on: ubuntu-20.04
@@ -73,7 +93,7 @@ jobs:
7393
REDIS_QUEUE_HOST: redis
7494
REDIS_STATE_HOST: redis
7595
container:
76-
image: faasm/cpp-sysroot:0.0.21
96+
image: faasm/cpp-sysroot:0.0.22
7797
defaults:
7898
run:
7999
working-directory: /code/cpp

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.21
1+
0.0.22

bin/cli.sh

-28
This file was deleted.

docker-compose.yml

-23
This file was deleted.

docs/release.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Dockerhub.
2121
To do this:
2222

2323
- Create a branch with your changes
24-
- Update the version in `VERSION`, `.env` and `.github/workflows`
24+
- Update the version in `VERSION`, `.env` and `.github/workflows/tests.yml`
2525
- Push this to your branch
2626
- Run `inv git.tag` to create the tag (from the head of the current branch)
2727
- Let the CI build run through and build the container

docs/usage.md

+5-9
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,16 @@ python3 <this repo>/bin/here.py
2121

2222
## Development
2323

24-
To develop the project you need to run the built container with your code
25-
mounted in it:
24+
To develop the project you need to go through Faasm as per [the
25+
docs](https://github.com/faasm/faasm/blob/master/docs/development.md).
2626

27-
```bash
28-
cd <this repo>
29-
./bin/cli.sh
27+
From inside the `cpp` CLI container spawned from there:
3028

29+
```bash
3130
# List available tasks
3231
inv -l
33-
```
3432

35-
You can then compile wasm or build and run the tests, e.g.:
36-
37-
```bash
33+
# Build tests
3834
inv dev.cmake
3935
inv dev.cc tests
4036
/build/bin/tests

0 commit comments

Comments
 (0)