-
Notifications
You must be signed in to change notification settings - Fork 3.3k
54 lines (43 loc) · 1.34 KB
/
test-api-contract.yaml
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
49
50
51
52
53
54
name: Test API Contract
on:
push:
branches:
- main
paths:
- "oasst-shared/**"
- "backend/**"
- "website/**"
pull_request:
paths:
- "oasst-shared/**"
- "backend/**"
- "website/**"
workflow_call:
jobs:
test-contract:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"
cache-dependency-path: "**/requirements*.txt"
- uses: actions/setup-node@v3
with:
node-version: 16
- run: pip install ./oasst-shared[dev]
- run: pip install ./oasst-data[dev]
- run: cd backend && pip install -r requirements.txt
- run: cd website && npm ci
- run: ./scripts/backend-development/start-mock-server.sh
- name: Run Python OasstApiClient contract tests
run: ./scripts/oasst-shared-development/test.sh
- name: Run JavaScript OasstApiClient contract tests
run: ./scripts/frontend-development/run-contract-test.sh
- run: ./scripts/backend-development/stop-mock-server.sh
#- uses: stefanzweifel/git-auto-commit-action@v4
# with:
# file_pattern: "docs/docs/api/openapi.json"
# commit_message:
# update docs/docs/api/openapi.json by run ${{ github.run_id }}