-
Notifications
You must be signed in to change notification settings - Fork 11
68 lines (68 loc) · 2.37 KB
/
entail_and_validate_changes.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Entail, validate changes, update database
on:
workflow_call:
inputs:
files-added:
type: string
files-modified:
type: string
files-removed:
type: string
repo-ref:
description: 'Branch, tag or commit'
type: string
default: 'master'
workflow_dispatch:
inputs:
files-added:
type: string
files-modified:
type: string
files-removed:
type: string
repo-ref:
description: 'Branch, tag or commit'
type: string
default: 'master'
jobs:
changes:
runs-on: ubuntu-latest
steps:
- name: Bring in repo
uses: actions/checkout@v3
with:
ref: ${{ inputs.repo-ref }}
- name: install Python dependencies
run: |
python -m pip install -U pip
pip install -r scripts/requirements.txt
- name: embed context into JSON/JSON-LD documents
run: |
a="${{ inputs.files-added }}"
m="${{ inputs.files-modified }}"
jsona=$(python -m ogc.na.ingest_json --batch --fs ',' -t -j --skip-on-missing-context "$a" --file-filter '\.json$')
jsonm=$(python -m ogc.na.ingest_json --batch --fs ',' -t -j --skip-on-missing-context "$m" --file-filter '\.json$')
echo "Added JSON-LD files: $jsona"
echo "Modified JSON-LD files: $jsonm"
echo "jsona=$jsona" >> $GITHUB_ENV
echo "jsonm=$jsonm" >> $GITHUB_ENV
- name: detect file changes
env:
DB_USERNAME: ${{secrets.DB_USERNAME}}
DB_PASSWORD: ${{secrets.DB_PASSWORD}}
RDF4JSERVER: ${{vars.RDF_SERVICE_URL}}
run: |
echo 'Run update script...'
a="${{inputs.files-added}},$jsona"
m="${{inputs.files-modified}},$jsonm"
r="${{inputs.files-removed}}"
if [ -z $a ]; then a="x"; fi
if [ -z $m ]; then m="x"; fi
if [ -z $r ]; then r="x"; fi
python scripts/update_vocabs.py -u -a "$a" -m "$m" -r "$r"
- name: commit serialised versions of concept schemes
uses: EndBug/add-and-commit@v7 # You can change this to use a specific version
with:
add: .
message: "Generated entailment and validation results and serialisations"
default_author: github_actions