-
Notifications
You must be signed in to change notification settings - Fork 26
72 lines (62 loc) · 2.38 KB
/
api_test.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
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
# Built from:
# https://github.com/Sage-Bionetworks/schematic/blob/develop/.github/workflows/test.yml
name: Test schematic API
on:
workflow_dispatch:
inputs:
perform_benchmarking:
required: true
type: boolean
description: perform benchmarking test (True) or skip (False)
jobs:
test:
runs-on: ubuntu-22.04
env:
POETRY_VERSION: 1.3.0
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10"]
steps:
#----------------------------------------------
# check-out repo and set-up python
#----------------------------------------------
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
#----------------------------------------------
# install & configure poetry
#----------------------------------------------
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org \
| python3 - --version ${{ env.POETRY_VERSION }};
poetry config virtualenvs.create true;
poetry config virtualenvs.in-project true;
#----------------------------------------------
# install dependencies and root project
#----------------------------------------------
- name: Install dependencies and root project
run: poetry install --no-interaction --all-extras
#----------------------------------------------
# run API test suite
#----------------------------------------------
- name: Run all API tests
env:
SYNAPSE_ACCESS_TOKEN: ${{ secrets.SYNAPSE_ACCESS_TOKEN }}
SERVICE_ACCOUNT_CREDS: ${{ secrets.SERVICE_ACCOUNT_CREDS }}
if: ${{ inputs.perform_benchmarking }}
run: >
source .venv/bin/activate;
pytest -m "schematic_api and not submission"
- name: Run API tests + Exclude Benchmarks
env:
SYNAPSE_ACCESS_TOKEN: ${{ secrets.SYNAPSE_ACCESS_TOKEN }}
SERVICE_ACCOUNT_CREDS: ${{ secrets.SERVICE_ACCOUNT_CREDS }}
if: ${{ false == inputs.perform_benchmarking }}
run: >
source .venv/bin/activate;
pytest -m "schematic_api and not submission and not rule_benchmark"