-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (53 loc) · 1.91 KB
/
TestExamples.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
name: TestExamples
on:
push:
branches:
- main
workflow_dispatch:
env:
WORKING_DIR: ./examples/
APP_PORT: 5001
jobs:
TestExamples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: run app
run: |
docker compose -f docker-compose.develop.yml up -d
sleep 10s
docker ps -a
- name: create csvw json-ld
working-directory: ${{env.WORKING_DIR}}
run: |
docker logs csvtocsvw
for file in *.csv
do
echo "$file"
RESULT=$(curl -X POST "http://localhost:${{env.APP_PORT}}/api/annotate" -H "accept: application/json" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"data_url\":\"https://github.com/Mat-O-Lab/CSVToCSVW/raw/main/examples/$file\"}")
FILEDATA=$(echo $RESULT | jq -r '.filedata')
FILENAME=$(echo $RESULT | jq -r '.filename')
echo $FILENAME
jq . <<< "$FILEDATA" > $FILENAME
done
docker logs csvtocsvw
- name: delete ttl files
working-directory: ${{env.WORKING_DIR}}
run: rm *.ttl
continue-on-error: true
- name: create csvw rdf
working-directory: ${{env.WORKING_DIR}}
run: |
for file in *-metadata.json
do
echo "$file"
curl -X POST "http://localhost:${{env.APP_PORT}}/api/rdf" -H "accept: application/json" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"metadata_url\":\"https://github.com/Mat-O-Lab/CSVToCSVW/raw/main/examples/$file\", \"format\":\"turtle\"}" -O -J
done
- name: Commit files # commit the output folder
uses: EndBug/add-and-commit@v9
with:
message: 'updated example output'
add: '*.* --force'
cwd: './examples/'