Skip to content

Commit

Permalink
Merge pull request #71 from unipoll/development
Browse files Browse the repository at this point in the history
Pydantic 2, better cli, docker-compose
  • Loading branch information
mike-pisman authored Oct 7, 2023
2 parents 41349d1 + ee2756e commit 44d071a
Show file tree
Hide file tree
Showing 35 changed files with 510 additions and 34,039 deletions.
40 changes: 30 additions & 10 deletions .github/workflows/postman.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,40 @@
name: Automatically build Postman documentation

on:
on:
workflow_dispatch:
inputs:
versionName:
description: 'The new version name'
required: true
default: '1.0.0'
releaseNotes:
description: 'The new version release notes'
required: false
default: ''

jobs:
automated-api-tests:
runs-on: arc-runner-k8s
steps:
- uses: actions/checkout@v3
- name: Install Postman CLI
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
curl -o- "https://dl-cli.pstmn.io/install/linux64.sh" | sh
- name: Login to Postman CLI
run: postman login --with-api-key ${{ secrets.POSTMAN_API_KEY }}
- name: Run API tests
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Get OpenAPI schema
run: |
postman collection run "${{ github.workspace }}/postman/collections/Automations: API-First Workflows.json" -e "19614303-61306d0f-9f72-418f-80ba-1561218563c9" --integration-id "129783-${{ github.run_id }}"
# Lint your API using Postman CLI
postman api lint --integration-id 129783
python main.py get-openapi
- name: Push OpenAPI to Postman
id: pushApi
uses: davidespihernandez/push-openapi-to-postman@v1
with:
path-to-definition: ./openapi.json
postman-api-key: ${{ secrets.POSTMAN_API_KEY }}
api-id: ${{ vars.POSTMAN_API_ID }}
api-path-to-file-name: openapi.json
version-name: ${{ github.event.inputs.versionName }}
release-notes: ${{ github.event.inputs.releaseNotes }}
10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ dmypy.json
# Pyre type checker
.pyre/

# vscode history
.history/
.vscode/settings.json
coverage.lcov
# vscode
.history
.vscode

# pytest
coverage.lcov
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ RUN tar -xf unipoll-api-*.tar.gz --strip-components=1

RUN pip install .

ENTRYPOINT [ "unipoll-api" ]
ENTRYPOINT [ "unipoll-api", "run" ]
16 changes: 16 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
services:
mongodb:
image: 'mongo:latest'
ports:
- '27017:27017'
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: changeme

api:
build: .
ports:
- '80:8000'
environment:
MONGODB_URL: mongodb://root:changeme@mongodb:27017
PORT: 8000
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@


if __name__ == "__main__":
app.run()
app.cli_entry_point()
Loading

0 comments on commit 44d071a

Please sign in to comment.