Skip to content

Commit

Permalink
Merge pull request #1 from rudexi/testing
Browse files Browse the repository at this point in the history
Testing
  • Loading branch information
rudexi authored Sep 28, 2021
2 parents fa2cb39 + 8d0dc13 commit 8c3acb9
Show file tree
Hide file tree
Showing 16 changed files with 1,557 additions and 1,689 deletions.
67 changes: 24 additions & 43 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,27 @@ on:
- v*

jobs:
python_tests:
pytest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
python3-dev
- name: Set up Python 3.8
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: '3.8'
python-version: '3.6'
architecture: 'x64'
- name: Install Poetry
run: python -m pip install 'poetry>=1.2.0a2'
- name: Cache Poetry
uses: actions/cache@v1
with:
path: ~/.local/share/virtualenvs
key: "{{ runner.os }}-poetry-test-{{ hashFIles('**/poetry.lock') }}"
- name: Install dependencies
id: install-deps
run: |
python -m pip install --upgrade pip
pip install \
pytest \
pytest-data \
pytest-mongodb \
pytest-spec \
pytest-timeout \
freezegun
pip install -r requirements.txt
pip install .
- name: Running Pytest
id: pytest
run: |
pytest
if: steps.cache-poetry.outputs.cache-hit != 'true'
run: poetry install --only default --only test
- name: Running Pylint
run: poetry run pytest

release:
runs-on: ubuntu-latest
Expand All @@ -62,32 +51,24 @@ jobs:

pypi:
runs-on: ubuntu-latest
needs: python_tests
needs: pytest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.x
- name: 'Set up Python 3.6'
uses: actions/setup-python@v2
with:
python-version: '3.x'
python-version: '3.6'
architecture: 'x64'
- name: Install dependencies
id: install-deps
run: |
python -m pip install --upgrade pip
pip install \
twine \
wheel
- name: Package application
id: package
run: |
python setup.py bdist_wheel
- name: Install Poetry
run: python -m pip install 'poetry>=1.2.0a2'
- name: Build
run: poetry build .
- name: Upload package to pypi
id: upload
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: |
twine upload dist/*
POETRY_HTTP_BASIC_PYPI_USERNAME: ${{ secrets.TWINE_USERNAME }}
POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: poetry publish

web:
runs-on: ubuntu-latest
Expand Down
70 changes: 47 additions & 23 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,64 @@
# vim:set softtabstop=2 shiftwidth=2 tabstop=2 expandtab:
---
name: Snooze-server testing

on:
pull_request:
branches: [ master ]

jobs:
tests:

lint:
runs-on: ubuntu-latest
if: ${{ false }} # Disabled for now
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: '3.6'
architecture: 'x64'

- name: Install Poetry
run: python -m pip install 'poetry>=1.2.0a2'

- name: Cache Poetry
uses: actions/cache@v1
with:
path: ~/.local/share/virtualenvs
key: "{{ runner.os }}-poetry-dev-{{ hashFIles('**/poetry.lock') }}"

- name: Install dependencies
if: steps.cache-poetry.outputs.cache-hit != 'true'
run: poetry install --only lint

- name: Running Pylint
run: poetry run pylint snooze/

tests:
# needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
python3-dev
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: '3.x'
python-version: '3.6'
architecture: 'x64'

- name: Install Poetry
run: python -m pip install 'poetry>=1.2.0a2'

- name: Cache Poetry
uses: actions/cache@v1
with:
path: ~/.local/share/virtualenvs
key: "{{ runner.os }}-poetry-test-{{ hashFIles('**/poetry.lock') }}"

- name: Install dependencies
id: install-deps
run: |
python -m pip install --upgrade pip
pip install \
pytest \
pytest-data \
pytest-mongodb \
pytest-spec \
pytest-timeout \
freezegun
pip install -r requirements.txt
pip install .
if: steps.cache-poetry.outputs.cache-hit != 'true'
run: poetry install --only default --only test

- name: Running Pytest
id: pytest
run: |
pytest
run: poetry run pytest

4 changes: 0 additions & 4 deletions MANIFEST.in

This file was deleted.

36 changes: 0 additions & 36 deletions Pipfile

This file was deleted.

Loading

0 comments on commit 8c3acb9

Please sign in to comment.