release v0.4.0 #18
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 install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
# TODO need to make these actions public! | |
# TODO need to revisit stragegy. As far as I understand, it is not possible to communicate between jobs. So this means that the | |
# extra installation is redundant. need to think about the scope of tests to run here! If you have your service hosted somewhere then you'll | |
# be able to call it directly | |
name: SDK Package | |
on: | |
push: | |
branches: [develop] | |
pull_request: | |
branches: [main] | |
jobs: | |
sdk-build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.10"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install .[test] | |
- name: Code Validation Stage | |
run: | | |
pre-commit run --all-files --show-diff-on-failure | |
- name: Test stage | |
run: | | |
coverage run -m pytest --verbose -rsfp tests/unit | |
#sdk-integration: | |
# runs-on: ubuntu-latest | |
# strategy: | |
# fail-fast: false | |
# matrix: | |
# python-version: ["3.7"] | |
# steps: | |
# - uses: actions/checkout@v3 | |
# - name: Set up Python ${{ matrix.python-version }} | |
# uses: actions/setup-python@v3 | |
# with: | |
# python-version: ${{ matrix.python-version }} | |
# - name: Install dependencies | |
# run: | | |
# python -m pip install --upgrade pip | |
# python -m pip install flake8 pytest coverage | |
# python -m pip install . | |
# - name: Lint with flake8 | |
# run: | | |
# # stop the build if there are Python syntax errors or undefined names | |
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics \ | |
# --exclude tests,experiments,pipeline | |
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
# - name: Run App | |
# run: | | |
# python -m pip install . | |
# cd in_n_out | |
# uvicorn main:app & | |
# - name: Initialise Postgres Container | |
# run: | | |
# docker run -d --rm --name postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_USERNAME=postgres -p 5432:5432 postgres | |
# - name: Test with pytest | |
# run: | | |
# coverage run -m pytest --verbose -rsfp tests/integration |