Skip to content

Commit

Permalink
WIP parse json output with jq #14
Browse files Browse the repository at this point in the history
  • Loading branch information
sroertgen committed Jan 30, 2024
1 parent 09897f8 commit df4daa6
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,16 @@ jobs:
- name: Determine matrix
id: set-matrix
run: |
changed_files_ttl=${{ fromJson(needs.changedfiles.outputs.ttl) }}
changed_files_yml=${{ fromJson(needs.changedfiles.outputs.yml) }}
all_files=${{ fromJson(needs.all-ttl-files.outputs.matrix) }}
changed_files_ttl=${{ toJSON(needs.changedfiles.outputs.ttl) }}
changed_files_yml=${{ toJSON(needs.changedfiles.outputs.yml) }}
if [ ${#changed_files_ttl[@]} -ne 0 ]; then
echo "$changed_files_ttl" | jq length
echo "$changed_files_yml" | jq length
if [ $(echo "$changed_files_ttl" | jq length) -gt 0 ]; then
echo ttl changed
echo "::set-output name=matrix::${{ toJSON(needs.changedfiles.outputs.ttl) }}"
elif [ ${#changed_files_yml[@]} -ne 0 ]; then
elif [ $(echo "$changed_files_yml" | jq length) -gt 0 ]; then
echo yml changed
echo "::set-output name=matrix::${{ toJSON(needs.all-ttl-files.outputs.matrix) }}"
else
echo "::set-output name=matrix::[]"
Expand All @@ -103,20 +106,20 @@ jobs:
- name: echo changed files
run: echo "${{ matrix.file }}"

- name: get shape
run: curl https://raw.githubusercontent.com/skohub-io/shapes/main/skohub.shacl.ttl --output skohub.shacl.ttl
# - name: get shape
# run: curl https://raw.githubusercontent.com/skohub-io/shapes/main/skohub.shacl.ttl --output skohub.shacl.ttl

- name: make fuseki directory
run: mkdir fuseki
# - name: make fuseki directory
# run: mkdir fuseki

- name: get fuseki inference config
run: curl https://raw.githubusercontent.com/skohub-io/shapes/main/fuseki/config_inference.ttl --output fuseki/config_inference.ttl
# - name: get fuseki inference config
# run: curl https://raw.githubusercontent.com/skohub-io/shapes/main/fuseki/config_inference.ttl --output fuseki/config_inference.ttl

- name: get query to check for violations
run: curl https://raw.githubusercontent.com/skohub-io/shapes/main/scripts/checkForViolation.rq --output scripts/checkForViolation.rq
# - name: get query to check for violations
# run: curl https://raw.githubusercontent.com/skohub-io/shapes/main/scripts/checkForViolation.rq --output scripts/checkForViolation.rq

- name: Validate with script
run: bash ./scripts/validate-skos -l violation -s skohub.shacl.ttl ${{ matrix.file }}
# - name: Validate with script
# run: bash ./scripts/validate-skos -l violation -s skohub.shacl.ttl ${{ matrix.file }}

# build:
# runs-on: ubuntu-latest
Expand Down

0 comments on commit df4daa6

Please sign in to comment.