-
-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (47 loc) · 1.53 KB
/
main.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
45
46
47
48
name: restroom-ci
on: [push]
jobs:
restroom_job:
runs-on: ubuntu-latest
name: 🚀 Start restroom and request some contracts
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v3
- name: 🚀 Start restroom
uses: ./
with:
restroom-contracts: "${{ github.workspace }}/contracts"
restroom-files: "${{ github.workspace }}/"
restroom-logger: "${{ github.workspace }}/"
- name: ⚙️ Execute a contract
run: |
curl -s -w "%{stderr}%{http_code}" http://localhost:3000/api/test 2>/tmp/status
if [[ `cat /tmp/status` != "200" ]]; then
echo -ne "\nerror: "
cat /tmp/status
exit 1
fi
- name: ⚙️ Execute a contract with files
run: |
curl -s -w "%{stderr}%{http_code}" http://localhost:3000/api/file_test 2>/tmp/status
if [[ `cat /tmp/status` != "200" ]]; then
echo -ne "\nerror: "
cat /tmp/status
exit 1
fi
- name: ⚙️ Execute a contract with logger
run: |
rm -f my.log
curl -s -w "%{stderr}%{http_code}" http://localhost:3000/api/logger_test 2>/tmp/status
if [[ `cat /tmp/status` != "200" ]]; then
printf "\nerror: "
cat /tmp/status
exit 1
fi
sleep 1
res=`cat my.log`
if [[ "$res" != "HELLOWORLD!" ]]; then
echo "Wrong content of log"
echo "$res"
exit 1
fi