-
Notifications
You must be signed in to change notification settings - Fork 3
107 lines (98 loc) · 3.8 KB
/
unit_tests.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# This workflow will run unit tests
name: Run Unit Tests
on:
push:
workflow_dispatch:
pull_request:
branches:
- master
jobs:
py_build_tests:
uses: neongeckocom/.github/.github/workflows/python_build_tests.yml@master
with:
python_version: "3.8"
docker_build_tests:
uses: neongeckocom/.github/.github/workflows/docker_build_tests.yml@master
unit_tests:
strategy:
max-parallel: 1
matrix:
python-version: [3.7, 3.8, 3.9, '3.10']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install . -r requirements/test_requirements.txt
- name: Export credentials
run: |
mkdir -p ~/.local/share/neon
echo ${WOLFRAM_ID} > ~/.local/share/neon/wolfram.txt
echo ${AV_API_KEY} > ~/.local/share/neon/alpha_vantage.txt
echo ${OWM_KEY} > ~/.local/share/neon/owm.txt
echo ${GENERIC_CONTROLLER_CONFIG} > ~/.local/share/neon/credentials.json
env:
WOLFRAM_ID: ${{secrets.wolfram_id}}
AV_API_KEY: ${{secrets.alpha_vantage_key}}
OWM_KEY: ${{secrets.open_weather_map_key}}
GENERIC_CONTROLLER_CONFIG: ${{secrets.generic_controller_config}}
- name: Test Client
run: |
pytest tests/test_client.py --doctest-modules --junitxml=tests/client-test-results.xml
env:
MAP_MAKER_KEY: ${{secrets.map_maker_key}}
- name: Test Cached API
run: |
pytest tests/test_cached_api.py --doctest-modules --junitxml=tests/cached-api-test-results.xml
- name: Upload cached API test results
uses: actions/upload-artifact@v2
with:
name: cached-api-test-results
path: tests/cached-api-test-results.xml
- name: Test Wolfram API
run: |
pytest tests/test_wolfram_api.py --doctest-modules --junitxml=tests/wolfram-api-test-results.xml
- name: Upload Wolfram API test results
uses: actions/upload-artifact@v2
with:
name: wolfram-api-test-results
path: tests/wolfram-api-test-results.xml
- name: Test Alpha Vantage API
run: |
pytest tests/test_alpha_vantage_api.py --doctest-modules --junitxml=tests/alphavantage-api-test-results.xml
- name: Upload Alpha Vantage API test results
uses: actions/upload-artifact@v2
with:
name: alphavantage-api-test-results
path: tests/alphavantage-api-test-results.xml
- name: Test OWM API
run: |
pytest tests/test_owm_api.py --doctest-modules --junitxml=tests/owm-api-test-results.xml
- name: Upload Open Weather Map API test results
uses: actions/upload-artifact@v2
with:
name: owm-api-test-results
path: tests/owm-api-test-results.xml
- name: Test Map Maker API
run: |
pytest tests/test_map_maker_api.py --doctest-modules --junitxml=tests/map-maker-api-test-results.xml
env:
MAP_MAKER_KEY: ${{secrets.map_maker_key}}
- name: Upload Map Maker API test results
uses: actions/upload-artifact@v2
with:
name: map-maker-api-test-results
path: tests/map-maker-api-test-results.xml
- name: Test Generic API
run: |
pytest tests/test_generic_controller.py --doctest-modules --junitxml=tests/generic-controller-test-results.xml
- name: Upload Generic API test results
uses: actions/upload-artifact@v2
with:
name: generic-controller-test-results
path: tests/generic-controller-test-results.xml