Refactor backend services to accept more configuration params in init #164
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |