-
-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (32 loc) · 1.23 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
on: [push]
jobs:
example:
runs-on: ubuntu-22.04
name: Test
steps:
# Gets a copy of the source code in your repository before running API tests
- uses: actions/checkout@v4.2.1
- uses: actions/setup-python@v5
with:
python-version: '3.12'
# Installs project's dependencies
- run: pip install -r apps/python/requirements.txt
# Start the API in the background
- run: python apps/python/app.py &
# Set sample access token
- name: Set access token
run: cat apps/python/secret.json | python3 -c "import sys, json; print(f'ACCESS_TOKEN={json.load(sys.stdin)[\"access_token\"]}')" >> $GITHUB_ENV
- name: Default test
uses: ./
with:
schema: 'http://127.0.0.1:5001/openapi.json'
token: ${{ secrets.SCHEMATHESIS_TOKEN }}
args: '-E success -H "Authorization: Bearer ${{ env.ACCESS_TOKEN }}"'
- name: Custom hooks
uses: ./
with:
schema: 'http://127.0.0.1:5001/openapi.json'
token: ${{ secrets.SCHEMATHESIS_TOKEN }}
version: 'latest'
hooks: 'apps.python.hooks'
args: '-c custom_check -E success -H "Authorization: Bearer ${{ env.ACCESS_TOKEN }}"'