Skip to content

Commit

Permalink
Merge 7661b1c into 18d197a
Browse files Browse the repository at this point in the history
  • Loading branch information
mirekys committed Mar 19, 2021
2 parents 18d197a + 7661b1c commit 48bf929
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 3 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Test python

on: [ push ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.8 ]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v2
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Runs Elasticsearch
uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: 7.6.0

- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel setuptools
pip install -e .[tests]
- name: Test with pytest
run: |
./run-tests.sh
- name: Check manifest
run: |
check-manifest
#
# - name: Coveralls
# uses: AndreMiras/coveralls-python-action@develop
# with:
# parallel: true
# flag-name: Test with pytest

# coveralls_finish:
# needs: build
# runs-on: ubuntu-latest
# steps:
# - name: Coveralls Finished
# uses: AndreMiras/coveralls-python-action@develop
# with:
# parallel-finished: true

- name: Build package to publish
run: |
python setup.py sdist bdist_wheel
- name: Publish package
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
# password: ${{ secrets.TEST_PYPI_PASSWORD }}
# repository_url: https://test.pypi.org/legacy/
2 changes: 1 addition & 1 deletion oarepo_ui/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.0.1'
__version__ = '2.0.2'
2 changes: 1 addition & 1 deletion oarepo_ui/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class EndpointOptionsView(MethodView):
def __init__(self, endpoint):
self.endpoint = endpoint

def options(self):
def options(self, *args, **kwargs):
ret = {}
index_name = self.endpoint['config'].get('search_index')
if index_name:
Expand Down
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import tempfile

import pytest
from config import RECORDS_REST_ENDPOINTS
from flask import Flask
from invenio_base.signals import app_loaded
from invenio_i18n import InvenioI18N
Expand All @@ -29,6 +28,8 @@
from oarepo_ui.views import create_blueprint_from_app as ui_blueprint_from_app
from tests.config import RECORDS_REST_FACETS

from .config import RECORDS_REST_ENDPOINTS


@pytest.yield_fixture(scope="function")
def app(request):
Expand Down

0 comments on commit 48bf929

Please sign in to comment.