Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing alternative CI with pipenv #1

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 Pipenv
run: python -m pip install pipenv wheel

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

- name: Install dependencies
if: steps.cache-pipenv.outputs.cache-hit != 'true'

run: pipenv install --deploy --dev
- name: Running Pylint
run: pipenv 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 Pipenv
run: python -m pip install pipenv wheel

- name: Cache Pipenv
uses: actions/cache@v1
with:
path: ~/.local/share/virtualenvs
key: "{{ runner.os }}-pipenv-{{ hashFIles('**/Pipfile.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-pipenv.outputs.cache-hit != 'true'
run: pipenv install --deploy --dev

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

2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ pytest-sugar = "*"
bandit = "*"
pylint = "*"
pytest-timeout = "*"
shovel = "*"
virtualenv = "*"
freezegun = "*"
autopep8 = "*"
72 changes: 24 additions & 48 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta:__legacy__"

[tool.autopep8]
max_line_length = 120
ignore = "E402" # https://github.com/hhatto/autopep8#features
in-place = true
recursive = true
aggressive = 3
Loading