Skip to content

Commit

Permalink
Checks. See #101.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioggstream committed Dec 10, 2021
1 parent 387dc57 commit be625ce
Show file tree
Hide file tree
Showing 4 changed files with 186 additions and 1 deletion.
44 changes: 44 additions & 0 deletions .github/workflows/ci-onto.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ "ndc-mvp/0.1" ]
paths-ignore:
- "**/*.md"
- "**/*.rdf"
- "**/*.jsonld"
- "VocabolariControllati/**"

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
test-onto-syntax:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.8'
architecture: 'x64'
- name: Run a script
run: |-
pip install pre-commit
pre-commit run -a onto-pyshacl
test-onto-latest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.8'
architecture: 'x64'
- name: Run a script
run: |-
pip install pre-commit
pre-commit run -a onto-latest
39 changes: 39 additions & 0 deletions .github/workflows/ci-vocab.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ "ndc-mvp/0.1" ]
paths-ignore:
- "**/*.md"
- "**/*.rdf"
- "**/*.jsonld"
- "Ontologie/**"

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
test-vocabularies:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: '3.8' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified

# Runs a single command using the runners shell
- name: Run a script
run: |-
pip install pre-commit
pre-commit run -a vocab-pyshacl
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
.DS_Store
.DS_Store
*.xml
*.xml
target/
.project
.settings
.classpath
.~*

*.jar

94 changes: 94 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#
# Run pre-commit hooks. You can run them without installing
# the hook with
#
# $ pre-commit run --all-files
#
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
# - id: trailing-whitespace
# - id: end-of-file-fixer
- id: check-yaml
args: [--allow-multiple-documents]
- id: check-added-large-files
args:
- "--maxkb=4000"
- repo: https://github.com/myint/autoflake
rev: v1.4
hooks:
- id: autoflake
args:
- --in-place
- --remove-unused-variables
- --remove-all-unused-imports
- repo: https://github.com/psf/black
rev: 21.12b0
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
name: isort (python)
# Use black profile for isort to avoid conflicts
# see https://github.com/PyCQA/isort/issues/1518
args: ["--profile", "black"]
- id: isort
name: isort (cython)
types: [cython]
- id: isort
name: isort (pyi)
types: [pyi]
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
- repo: https://github.com/Lucas-C/pre-commit-hooks-safety
rev: v1.2.2
hooks:
- id: python-safety-dependencies-check
- repo: local
hooks:
- id: jsonschema
name: jsonschema
entry: python -m dati_playground validate --validate-jsonschema=true
files: '.*\.schema.yaml'
language: python
types:
- file
additional_dependencies:
- git+https://github.com/ioggstream/json-semantic-playground.git
- id: onto-pyshacl
name: pyshacl ontologies
entry: python -m dati_playground validate --validate-shacl=true
files: >-
^Ontologie\/[^/]+\/latest/.*\.ttl
types:
- file
language: python
additional_dependencies:
- git+https://github.com/ioggstream/json-semantic-playground.git
- id: onto-latest
name: Ontologies latest validator
entry: python -m dati_playground validate --validate-versioned-directory=true
files: >-
^Ontologie\/.*\.ttl
language: python
types:
- file
additional_dependencies:
- git+https://github.com/ioggstream/json-semantic-playground.git
- id: vocab-pyshacl
name: pyshacl vocabularies
entry: python -m dati_playground validate --validate-shacl=true
files:
^VocabolariControllati\/.*\.ttl
language: python
types:
- file
additional_dependencies:
- git+https://github.com/ioggstream/json-semantic-playground.git

0 comments on commit be625ce

Please sign in to comment.