Skip to content

Commit

Permalink
add schemathesis
Browse files Browse the repository at this point in the history
  • Loading branch information
frankkilcommins committed Oct 24, 2023
1 parent 045b977 commit 2dd90f8
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions .github/workflows/API-Provider-CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:

jobs:
lint-api:
name: Run Spectral
name: linting-api
runs-on: ubuntu-latest
steps:
# Check out the repository
Expand All @@ -30,9 +30,34 @@ jobs:
file_glob: 'apis/*.yaml'
spectral_ruleset: '.spectral.yaml'

functional-test-api:

validation-implementation:
needs: lint-api
runs-on: ubuntu-latest
steps:
- name: 'Checkout code'
uses: actions/checkout@main
- name: Setup the stack
run: docker-compose up -d
- name: Get Container Name
id: get-container
run: |
docker ps -a
CONTAINER_ID=$(docker ps -aqf "name=webinar-security-by-design_web_1")
echo "::set-output name=container_id::$CONTAINER_ID"
- name: Migrate DB and Seed within ${{ steps.get-container.outputs.container_id }}
run: |
docker exec -t ${{ steps.get-container.outputs.container_id }} alembic upgrade heads
docker exec ${{ steps.get-container.outputs.container_id }} python src/fixtures.py
- uses: schemathesis/action@v1
with:
schema: './apis/crapi.yaml'
base-url: 'http://0.0.0.0:8000'
args: '--dry-run --validate-schema true'

functional-test-api:
needs: [lint-api, validation-implementation]
runs-on: ubuntu-latest
steps:
- name: 'Checkout code'
uses: actions/checkout@main
Expand All @@ -57,7 +82,7 @@ jobs:
ENDPOINT: http://0.0.0.0:8000

security-test-api:
needs: [lint-api, functional-test-api]
needs: [lint-api, validation-implementation, functional-test-api]
runs-on: ubuntu-latest
steps:
- name: 'Checkout code'
Expand Down

0 comments on commit 2dd90f8

Please sign in to comment.