Add test save #1926
Workflow file for this run
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
name: CI Tests | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
- 'push-action/**' | |
jobs: | |
tests: | |
name: External | |
uses: SINTEF/ci-cd/.github/workflows/ci_tests.yml@v2.6.0 | |
with: | |
# General | |
install_extras: "[dev,docs]" | |
# pre-commit | |
run_pre-commit: true | |
python_version_pre-commit: "3.9" | |
skip_pre-commit_hooks: pylint | |
# pylint | |
run_pylint: true | |
python_version_pylint_safety: "3.9" | |
pylint_options: "--rcfile=pyproject.toml" | |
pylint_targets: "*.py tools emmopy ontopy" | |
# safety | |
# Ignore ID 44715 for now. | |
# See this NumPy issue for more information: https://github.com/numpy/numpy/issues/19038 | |
# Also ignore IDs 44716 and 44717 as they are not deemed to be as severe as it is | |
# laid out in the CVE. | |
# Remove ignoring 48547 as soon as RDFLib/rdflib#1844 has been fixed and the fix | |
# has been released. | |
run_safety: true | |
safety_options: | | |
--ignore=44715 | |
--ignore=44716 | |
--ignore=44717 | |
--ignore=48547 | |
# Build distribution | |
run_build_package: true | |
python_version_package: "3.9" | |
build_cmd: "python -m build" | |
# Build documentation | |
# Exclude base classes in emmopy.emmocheck | |
run_build_docs: true | |
python_version_docs: "3.9" | |
update_python_api_ref: true | |
update_docs_landing_page: true | |
package_dirs: | | |
emmopy | |
ontopy | |
special_file_api_ref_options: "emmopy/emmocheck.py,show_bases: false" | |
landing_page_replacements: | | |
(LICENSE.txt),(LICENSE.md) | |
(tools),(../tools) | |
pytest: | |
name: pytest | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install system dependencies | |
run: sudo apt-get update && sudo apt-get install -y graphviz openjdk-11-jre-headless | |
- name: Install Python dependencies (and EMMOntoPy) | |
run: | | |
python -m pip install --upgrade pip | |
pip install -U setuptools wheel | |
pip install -U -e .[dev] | |
- name: Test | |
run: pytest -vvv --cov=ontopy --cov=emmopy --cov-report=xml --cov-report=term --doctest-modules | |
- name: Upload coverage to Codecov | |
if: matrix.python-version == '3.9' && github.repository == 'emmo-repo/EMMOntoPy' | |
uses: codecov/codecov-action@v3 | |
# - name: Run vertical demo | |
# run: | | |
# cd demo/vertical | |
# python define_ontology.py | |
# python plot_ontology.py | |
# cd - | |
# - name: Run horizontal demo | |
# run: | | |
# cd demo/horizontal | |
# python step1_generate_metadata.py | |
# python step2_define_metadata.py | |
# python step3_instantiate.py | |
# python step4_map_instance.py | |
# cd - | |
ontodoc: | |
name: EMMO documentation (test using ontodoc) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- name: Check Ubuntu version we are running under | |
run: | | |
uname -a | |
sudo apt-get update | |
- name: Current environment | |
run: env | |
- name: Install pandoc 2.1.2 | |
run: | | |
#sudo apt-get install -y pandoc | |
wget https://github.com/jgm/pandoc/releases/download/2.1.2/pandoc-2.1.2-1-amd64.deb | |
sudo apt-get install -y ./pandoc-2.1.2-1-amd64.deb | |
- name: Install tzdata non-interactively | |
run: | | |
sudo ln -fs /usr/share/zoneinfo/Europe/Oslo /etc/localtime | |
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y --no-install-recommends tzdata | |
sudo dpkg-reconfigure --frontend noninteractive tzdata | |
- name: Install other dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
sudo apt-get update | |
sudo apt-get install -y graphviz | |
sudo apt-get install -y texlive-xetex | |
sudo apt-get install -y texlive-latex-extra | |
- name: Install EMMOntoPy | |
run: | | |
python setup.py install | |
- name: Create EMMO documentation | |
run: | | |
cd examples/emmodoc | |
python ../../tools/ontodoc -f simple-html emmo-inferred emmo-simple.html | |
python ../../tools/ontodoc -t emmo.md -p no-self-contained emmo-inferred emmo.html | |
# pdf generation is commented out as there is a xetex error which | |
# needs to be resolved if we decide to keep ontodoc as a tool. | |
# python ../../tools/ontodoc -t emmo.md emmo-inferred emmo.pdf | |
cd - |