forked from linkml/linkml-model
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactoring documentation, updating spec, switching repo to poetry
- Loading branch information
Showing
24 changed files
with
1,453 additions
and
1,141 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 |
---|---|---|
@@ -1,58 +1,67 @@ | ||
name: Build | ||
# Built from: | ||
# https://docs.github.com/en/actions/guides/building-and-testing-python | ||
# https://github.com/snok/install-poetry#workflows-and-tips | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
name: Build and test linkml-runtime | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
unittests-n-commits: | ||
test: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.9", "3.10"] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Update requirements files and test | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pipenv-to-requirements | ||
pipenv_to_requirements | ||
pip install -r requirements.txt | ||
pip install -r requirements-dev.txt | ||
- name: Run make file | ||
run: | | ||
make | ||
- name: Run unit tests over output | ||
run: | | ||
pip install pipenv | ||
pipenv install --dev | ||
pipenv run python -m unittest discover -p 'test_*.py' | ||
- name: Check in changes to requirements files | ||
run: | | ||
git add requirements*.txt | ||
if [[ ! -z $(git status -s requirements*.txt) ]] | ||
then | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git commit -m 'Automatically generated requirements.txt and requirements-dev.txt' requirements*.txt | ||
git push | ||
fi | ||
- name: Check updated content | ||
run: | | ||
find linkml_model -name __pycache__ -type d -prune -exec rm -rf '{}' '+' | ||
git add --force docs linkml_model | ||
if [[ ! -z $(git status -s .) ]] | ||
then | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git commit -m 'Updating generated outputs' . | ||
git push | ||
fi | ||
|
||
#---------------------------------------------- | ||
# check-out repo and set-up python | ||
#---------------------------------------------- | ||
- name: Check out repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
#---------------------------------------------- | ||
# install & configure poetry | ||
#---------------------------------------------- | ||
- name: Install Poetry | ||
uses: snok/[email protected] | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
|
||
#---------------------------------------------- | ||
# load cached venv if cache exists | ||
#---------------------------------------------- | ||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
#---------------------------------------------- | ||
# install dependencies if cache does not exist | ||
#---------------------------------------------- | ||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
|
||
#---------------------------------------------- | ||
# install your root project, if required | ||
#---------------------------------------------- | ||
- name: Install library | ||
run: poetry install --no-interaction | ||
|
||
#---------------------------------------------- | ||
# run test suite | ||
#---------------------------------------------- | ||
- name: Run tests | ||
run: make test | ||
|
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 |
---|---|---|
|
@@ -13,19 +13,23 @@ jobs: | |
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v2.2.2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install Poetry | ||
uses: snok/[email protected] | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install wheel | ||
run: poetry install --no-interaction | ||
|
||
- name: build a binary wheel dist | ||
- name: Build source and wheel archives | ||
run: | | ||
rm -fr dist | ||
python setup.py bdist_wheel sdist | ||
poetry version $(git describe --tags --abbrev=0) | ||
poetry build | ||
- name: Publish distribution 📦 to PyPI | ||
uses: pypa/[email protected] | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.