mirror of
https://github.com/Cian-H/invenio-config-iform.git
synced 2025-12-22 13:11:56 +00:00
setup: change to reusable github workflows
* move check_manifest configuration to setup.cfg * remove upper constraint for pytest-black
This commit is contained in:
21
.github/workflows/pypi-publish.yml
vendored
21
.github/workflows/pypi-publish.yml
vendored
@@ -5,22 +5,5 @@ on:
|
||||
|
||||
jobs:
|
||||
build-n-publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python 3.7
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.7
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install setuptools wheel "babel<=2.9.1"
|
||||
- name: Build package
|
||||
run: |
|
||||
python setup.py compile_catalog sdist bdist_wheel
|
||||
- name: pypi-publish
|
||||
uses: pypa/gh-action-pypi-publish@v1.3.1
|
||||
with:
|
||||
user: __token__
|
||||
password: ${{ secrets.pypi_password }}
|
||||
uses: tu-graz-library/.github/.github/workflows/pypi-publish.yml@main
|
||||
secrets: inherit
|
||||
|
||||
50
.github/workflows/tests.yml
vendored
50
.github/workflows/tests.yml
vendored
@@ -16,51 +16,5 @@ on:
|
||||
default: 'Manual trigger'
|
||||
|
||||
jobs:
|
||||
Tests:
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [3.8, 3.9]
|
||||
requirements-level: [pypi]
|
||||
db-service: [postgresql13]
|
||||
search-service: [opensearch2]
|
||||
include:
|
||||
- db-service: postgresql13
|
||||
DB_EXTRAS: "postgresql"
|
||||
|
||||
- search-service: opensearch2
|
||||
SEARCH_EXTRAS: "opensearch2"
|
||||
|
||||
env:
|
||||
DB: ${{ matrix.db-service }}
|
||||
SEARCH: ${{ matrix.search-service }}
|
||||
EXTRAS: tests,${{ matrix.SEARCH_EXTRAS }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Generate dependencies
|
||||
run: |
|
||||
pip install wheel requirements-builder
|
||||
requirements-builder -e "$EXTRAS" --level=${{ matrix.requirements-level }} setup.py > .${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('.${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt') }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install -r .${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt
|
||||
pip install ".[$EXTRAS]"
|
||||
pip freeze
|
||||
docker --version
|
||||
docker-compose --version
|
||||
- name: Run tests
|
||||
run: |
|
||||
./run-tests.sh
|
||||
tests:
|
||||
uses: tu-graz-library/.github/.github/workflows/tests.yml@main
|
||||
|
||||
@@ -23,7 +23,7 @@ function cleanup() {
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
python -m check_manifest --ignore ".*-requirements.txt"
|
||||
python -m check_manifest
|
||||
python -m sphinx.cmd.build -qnN docs docs/_build/html
|
||||
eval "$(docker-services-cli up --search ${SEARCH:-elasticsearch} --env)"
|
||||
python -m pytest
|
||||
|
||||
@@ -42,7 +42,7 @@ install_requires =
|
||||
|
||||
[options.extras_require]
|
||||
tests =
|
||||
pytest-black>=0.3.0,<0.3.10
|
||||
pytest-black>=0.3.0
|
||||
Sphinx>=4.5.0
|
||||
pytest-invenio>=1.4.7
|
||||
# elasticsearch7 =
|
||||
@@ -95,6 +95,10 @@ output-dir = invenio_config_tugraz/translations/
|
||||
[isort]
|
||||
profile=black
|
||||
|
||||
[check-manifest]
|
||||
ignore =
|
||||
*-requirements.txt
|
||||
|
||||
[tool:pytest]
|
||||
addopts = --black --isort --pydocstyle --doctest-glob="*.rst" --doctest-modules --cov=invenio_config_tugraz --cov-report=term-missing tests invenio_config_tugraz
|
||||
testpaths = tests invenio_config_tugraz
|
||||
|
||||
Reference in New Issue
Block a user