Skip to content

Commit

Permalink
Update github action to include st
Browse files Browse the repository at this point in the history
Signed-off-by: aryan <aryangodara03@gmail.com>
  • Loading branch information
AryanGodara committed Jan 13, 2023
1 parent dfcfa1f commit fd6734f
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 160 deletions.
131 changes: 120 additions & 11 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Deploy GitHub Pages

on:
push:
branches:
- master
on: [push, pull_request]

jobs:
deploy:
Expand All @@ -24,11 +21,123 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: swagger-ui
cname: api.mainflux.io

apitests:
runs-on: ubuntu-latest
api-tests:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Testit
run: make endtoend
- name: start containers
run: make run

# Auth.yml
- name: Run st for auth.yml
uses: schemathesis/action@v1
with:
# API schema location
schema: './api/openapi/auth.yml'
base-url: 'http://localhost'
# Set your token from secrets
token: ${{ secrets.SCHEMATHESIS_TOKEN }}

# Bootstrap.yml
- name: Run st for bootstrap.yml
uses: schemathesis/action@v1
with:
# API schema location
schema: './api/openapi/bootstrap.yml'
base-url: 'http://localhost'
# Set your token from secrets
token: ${{ secrets.SCHEMATHESIS_TOKEN }}

# Certs.yml
- name: Run st for certs.yml
uses: schemathesis/action@v1
with:
# API schema location
schema: './api/openapi/certs.yml'
base-url: 'http://localhost'
# Set your token from secrets
token: ${{ secrets.SCHEMATHESIS_TOKEN }}

# Consumers-notifiers.yml
- name: Run st for consumers-notifiers.yml
uses: schemathesis/action@v1
with:
# API schema location
schema: './api/openapi/consumers-notifiers.yml'
base-url: 'http://localhost'
# Set your token from secrets
token: ${{ secrets.SCHEMATHESIS_TOKEN }}

# Http.yml
- name: Run st for http.yml
uses: schemathesis/action@v1
with:
# API schema location
schema: './api/openapi/http.yml'
base-url: 'http://localhost'
# Set your token from secrets
token: ${{ secrets.SCHEMATHESIS_TOKEN }}

# Provision.yml
- name: Run st for provision.yml
uses: schemathesis/action@v1
with:
# API schema location
schema: './api/openapi/provision.yml'
base-url: 'http://localhost'
# Set your token from secrets
token: ${{ secrets.SCHEMATHESIS_TOKEN }}

# Readers.yml
- name: Run st for readers.yml
uses: schemathesis/action@v1
with:
# API schema location
schema: './api/openapi/readers.yml'
base-url: 'http://localhost'
# Set your token from secrets
token: ${{ secrets.SCHEMATHESIS_TOKEN }}

# Things.yml
- name: Run st for things.yml
uses: schemathesis/action@v1
with:
# API schema location
schema: './api/openapi/things.yml'
base-url: 'http://localhost'
# Set your token from secrets
token: ${{ secrets.SCHEMATHESIS_TOKEN }}

# Twins.yml
- name: Run st for twins.yml
uses: schemathesis/action@v1
with:
# API schema location
schema: './api/openapi/twins.yml'
base-url: 'http://localhost'
# Set your token from secrets
token: ${{ secrets.SCHEMATHESIS_TOKEN }}

# Users.yml
- name: Run st for users.yml
uses: schemathesis/action@v1
with:
# API schema location
schema: './api/openapi/users.yml'
base-url: 'http://localhost'
# Set your token from secrets
token: ${{ secrets.SCHEMATHESIS_TOKEN }}

# Websocket.yml
- name: Run st for websocket.yml
uses: schemathesis/action@v1
with:
# API schema location
schema: './api/openapi/websocket.yml'
base-url: 'http://localhost'
# Set your token from secrets
token: ${{ secrets.SCHEMATHESIS_TOKEN }}


- name: Stop the running docker containers
run: sudo docker-compose -f docker/docker-compose.yml down
17 changes: 0 additions & 17 deletions .github/workflows/st.yml

This file was deleted.

108 changes: 0 additions & 108 deletions scripts/Makefile

This file was deleted.

25 changes: 1 addition & 24 deletions scripts/end-to-end.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,8 @@
# Uses Schemathesis to check the openAPI configuration with the actual endpoints
###

chmod 776 end-to-end.sh

cd ..

echo running all docker containers now
sudo make run

echo "now provisioning for MF_TOKEN"

#

EMAIL=example@eg.com
PASSWORD=12345678
DEVICE=mf-device
Expand All @@ -43,18 +34,4 @@ echo setting mf base path
export MF_BASE_PATH=$(pwd)

echo setting mf auth bearer token
export MF_TOKEN=$JWTTOKEN
#TODO: Define rest of the constants like {id} or {key} , etc.
printf "Got the MF_TOKEN : $MF_TOKEN \n"

#! TASK -> Automate below step instead of manually typing

# cd ./scripts
# make test
# cd -

# echo deleting the stapi container
# sudo docker rm stapi

# echo stopping the running containers
# sudo docker-compose -f docker/docker-compose.yml down
export MF_TOKEN=$JWTTOKEN

0 comments on commit fd6734f

Please sign in to comment.