-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Alex Kanitz <alexander.kanitz@alumni.ethz.ch>
- Loading branch information
1 parent
71433c2
commit f0905d0
Showing
9 changed files
with
118 additions
and
120 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
# 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 | ||
|
||
name: Python package | ||
|
||
on: | ||
push: | ||
branches: [ dev ] | ||
pull_request: | ||
branches: [ dev ] | ||
|
||
jobs: | ||
Test: | ||
name: Run linting and unit tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
python-version: ["3.7", "3.8", "3.9", "3.10"] | ||
|
||
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 requirements | ||
run: | | ||
pip install -e . | ||
pip install -r requirements_dev.txt | ||
- name: Lint with flake8 | ||
run: flake8 | ||
- name: Calculate unit test coverage | ||
run: | | ||
coverage run --source foca -m pytest | ||
coverage xml | ||
- name: Submit Report to Codecov | ||
uses: codecov/codecov-action@v2 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./coverage.xml | ||
fail_ci_if_error: true | ||
verbose: true | ||
- name: Run tests on petstore app | ||
run: | | ||
cd ./examples/petstore | ||
docker-compose up --build -d | ||
cd ../.. | ||
sleep 10 | ||
pytest ./tests/integration_tests.py | ||
Docker: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
python-version-tag: [["3.7", "3.7"], ["3.8", "3.8"], ["3.9", "3.9"], ["3.9", "latest"]] | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
- name: Build & Publish image to DockerHub | ||
env: | ||
docker_username: ${{ secrets.DOCKER_USERNAME }} | ||
docker_password: ${{ secrets.DOCKER_PASSWORD }} | ||
docker_org: ${{ secrets.DOCKER_ORG }} | ||
repo_name: ${{ github.event.repository.name }} | ||
run: | | ||
export branch_name=${GITHUB_HEAD_REF##*/} | ||
if [[ "$branch_name" == "dev" ]]; then | ||
export tag="$(date '+%Y%m%d')" | ||
else | ||
export tag=${branch_name} | ||
fi | ||
if [[ ${{ matrix.python-version-tag[1] }} == "latest" ]]; then | ||
export tag=${{ matrix.python-version-tag[1] }} | ||
else | ||
export tag=${tag}-py${{ matrix.python-version-tag[1] }} | ||
fi | ||
docker build . -t ${docker_org}/${repo_name}:latest \ | ||
-f docker/Dockerfile_py${{ matrix.python-version-tag[0] }} | ||
docker tag ${docker_org}/${repo_name} ${docker_org}/${repo_name}:${tag} | ||
echo $docker_password | docker login -u $docker_username --password-stdin | ||
if [[ "$tag" == "latest" ]]; then | ||
if [[ "$branch_name" == "dev" ]]; then | ||
docker push ${docker_org}/${repo_name}:${tag} | ||
fi | ||
else | ||
docker push ${docker_org}/${repo_name}:${tag} | ||
fi | ||
rm ${HOME}/.docker/config.json |
This file was deleted.
Oops, something went wrong.
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
"""FOCA root package.""" | ||
|
||
__version__ = '0.7.0' | ||
__version__ = '0.8.0' |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
addict==2.2.1 | ||
celery==5.2.2 | ||
connexion==2.7.0 | ||
Flask==1.1.2 | ||
connexion==2.11.2 | ||
cryptography==36.0.2 | ||
Flask==2.0.3 | ||
Flask-Cors==3.0.9 | ||
Flask-PyMongo==2.3.0 | ||
mongomock==3.19.0 | ||
pydantic==1.8.2 | ||
PyJWT==1.7.1 | ||
pymongo==3.10.1 | ||
PyYAML==5.4 | ||
requests==2.23.0 | ||
requests==2.27.1 | ||
swagger-ui-bundle==0.0.6 | ||
toml==0.10.0 | ||
typing==3.7.4.1 | ||
Werkzeug==1.0.1 | ||
Werkzeug==2.0.3 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
coverage==5.1 | ||
coveralls==2.0.0 | ||
flake8==3.7.9 | ||
mongomock==3.19.0 | ||
pylint==2.5.3 | ||
pytest==5.4.3 | ||
python-semantic-release==7.15.0 | ||
coverage==6.3.2 | ||
flake8==4.0.1 | ||
mongomock==4.0.0 | ||
pylint==2.13.2 | ||
pytest==7.1.1 | ||
python-semantic-release==7.27.0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[flake8] | ||
exclude = .git,venv,env | ||
exclude = .git,.eggs,build,venv,env | ||
max-line-length = 79 | ||
|
||
[semantic_release] | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,6 +62,6 @@ | |
include_package_data=True, | ||
setup_requires=[ | ||
"setuptools_git==1.2", | ||
"twine==3.1.1" | ||
"twine==3.8.0" | ||
], | ||
) |