-
Notifications
You must be signed in to change notification settings - Fork 1
86 lines (69 loc) · 2.37 KB
/
Copy pathtests.yml
File metadata and controls
86 lines (69 loc) · 2.37 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Tests
on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
jobs:
# Typecheck and the offline tests. Needs no credentials, so this still runs on
# forks, where the integration job has no secrets and every test errors.
unit-tests:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
name: Checkout fragment-python
- name: Use Python 3.10.14
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: '3.10.14'
- name: Install dependencies
run: |
pip install poetry
poetry install --with dev
- name: Typecheck
run: make typecheck
- name: Run offline tests
run: make unit
integration-tests:
runs-on: ubuntu-latest
permissions:
contents: read
env:
CLIENT_ID: ${{secrets.CLIENT_ID}}
CLIENT_SECRET: ${{secrets.CLIENT_SECRET}}
SCOPE: ${{secrets.SCOPE}}
AUTH_URL: ${{secrets.AUTH_URL}}
API_URL: ${{secrets.API_URL}}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
name: Checkout fragment-python
- name: Use Python 3.10.14
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: '3.10.14'
- name: Install dependencies
run: |
pip install poetry
poetry install --with dev
- name: Run tests
run: poetry run pytest -v
# Regenerates the clients in tests/snapshots/ and fails if the output differs
# from what is committed. Needs no credentials -- codegen only downloads the
# public GraphQL schema -- so it is a separate job and still runs on forks.
snapshots:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
name: Checkout fragment-python
- name: Use Python 3.10.14
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: '3.10.14'
- name: Install dependencies
run: |
pip install poetry
poetry install --with dev
- name: Check generated clients match snapshots
run: make check-snapshots