-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (44 loc) · 1.81 KB
/
faas_fn_build_invoke.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Tests
on:
push:
branches:
- "*"
paths-ignore:
- "*.adoc"
pull_request:
paths-ignore:
- "*.adoc"
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Install OpenFaaS CLI
run: curl -sSL https://cli.openfaas.com | sudo -E sh
- name: Build Function from scratch and invoke it
run: |
mkdir test
cd test
faas template pull https://github.com/${{ github.repository_owner }}/faas-bb#${{ github.head_ref || github.ref_name }}
faas new --lang bb my-bb-function --prefix ghcr.io/${{ github.repository_owner }}
faas build -f my-bb-function.yml
if [ "$(echo "Hello world" | docker run -i ghcr.io/${{ github.repository_owner }}/my-bb-function:latest ./index.clj)" != "Hello world" ]; then
exit 1
fi
- name: Build provided Function examples and invoke them
env:
DOCKER_REGISTRY_IMG_ORG_PATH: ghcr.io/${{ github.repository_owner }}
run: |
git clone https://github.com/${{ github.repository_owner }}/faas-bb.git
cd faas-bb/examples
git checkout ${{ github.head_ref || github.ref_name }}
faas template pull https://github.com/${{ github.repository_owner }}/faas-bb#${{ github.head_ref || github.ref_name }}
faas build
if [ "$(echo world | docker run -i ghcr.io/${{ github.repository_owner }}/bb-hello:latest ./index.clj)" != "Hello, world" ]; then
exit 1
fi
if [ "$(echo '{"a" {"b" 10}}' | docker run -i ghcr.io/${{ github.repository_owner }}/bb-lib:latest ./index.clj)" != "[10]" ]; then
exit 2
fi
if [ -n "$(echo '{"a" 10}' | docker run -i ghcr.io/${{ github.repository_owner }}/bb-lib:latest ./index.clj)" ]; then
exit 3
fi