WIP Adjust path to query #14 #67
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: Build /public and deploy to gh-pages with docker container | |
on: | |
push: | |
workflow_dispatch: | |
inputs: | |
logLevel: | |
description: 'Log level' | |
required: true | |
default: 'warning' | |
tags: | |
description: 'Test scenario tags' | |
jobs: | |
all-ttl-files: | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.file-list }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Find TTL files | |
id: find-ttl | |
run: | | |
ttl_files=$(find . -name '*.ttl' -printf '"%p",' | sed 's/,$//') | |
echo "ttl_files=$ttl_files" | |
echo "ttl_files=$ttl_files" >> "$GITHUB_ENV" | |
- name: Set matrix for TTL files | |
id: set-matrix | |
run: echo "::set-output name=file-list::[${ttl_files}]" | |
- name: List all changed files | |
run: echo "${ttl_files}" | |
changedfiles: | |
runs-on: ubuntu-latest | |
outputs: | |
ttl: ${{ steps.set-ttl-matrix.outputs.ttl }} | |
yml: ${{ steps.set-yml-matrix.outputs.yml }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- name: Get changed ttl-files | |
id: changed-ttl-files | |
uses: tj-actions/changed-files@v42 | |
with: | |
files: | | |
**/*.ttl | |
json: true | |
- name: Get changed yml-files | |
id: changed-yml-files | |
uses: tj-actions/changed-files@v42 | |
with: | |
files: | | |
**/*.yml | |
json: true | |
- name: Set turtle file matrix | |
id: set-ttl-matrix | |
run: echo "ttl=${{ steps.changed-ttl-files.outputs.all_changed_files }}" >> $GITHUB_OUTPUT | |
- name: Set yml file matrix | |
id: set-yml-matrix | |
run: echo "yml=${{ steps.changed-yml-files.outputs.all_changed_files }}" >> $GITHUB_OUTPUT | |
- name: List all changed files | |
run: echo '${{ steps.changed-ttl-files.outputs.all_changed_files }}' | |
- name: List all changed files | |
run: echo '${{ steps.changed-yml-files.outputs.all_changed_files }}' | |
validate: | |
runs-on: ubuntu-latest | |
needs: [changedfiles, all-ttl-files] | |
# only run there are changed files | |
# TODO enable after testing | |
# if: ${{needs.changedfiles.outputs.ttl != '[]' || needs.changedfiles.outputs.yml != '[]'}} | |
strategy: | |
max-parallel: 1 | |
fail-fast: false # other validation jobs should continue checking even if one file is invalid | |
matrix: | |
# file: ${{ fromJSON(needs.changedfiles.outputs.ttl) || fromJson(needs.all-ttl-files.outputs.matrix) }} | |
file: ${{ fromJson(needs.all-ttl-files.outputs.matrix) }} | |
steps: | |
- uses: actions/checkout@v3 | |
- 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: 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 query to check for violations and warning | |
run: curl https://raw.githubusercontent.com/skohub-io/shapes/main/scripts/checkForBoth.rq --output scripts/checkForBoth.rq | |
- run: | | |
ls -la | |
ls -la scripts | |
ls -la fuseki | |
- name: Validate with script | |
run: bash ./scripts/validate-skos -s skohub.shacl.ttl ${{ matrix.file }} | |
# build: | |
# runs-on: ubuntu-latest | |
# needs: [changedfiles, validate] | |
# steps: | |
# - name: Checkout 🛎️ | |
# uses: actions/checkout@v2 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly. | |
# with: | |
# persist-credentials: false | |
# - name: remove public and data-dir if already exists | |
# run: rm -rf public data | |
# - run: mkdir public | |
# - run: chmod -R 777 public # user in container is node which won't have write access to public | |
# - run: mkdir data | |
# - run: chmod -R 777 data # user in container is node which won't have write access to public | |
# - run: git clone https://github.com/skohub-io/skohub-docker-vocabs.git data/ # <-- add link to your repo here | |
# - name: make .env file | |
# run: echo "BASEURL=/skohub-docker-vocabs" > .env | |
# - name: build public dir with docker image | |
# run: > | |
# docker run | |
# -v $(pwd)/public:/app/public | |
# -v $(pwd)/data:/app/data | |
# -v $(pwd)/.env:/app/.env | |
# -e GATSBY_RESPOSITORY_URL=https://github.com/skohub-io/skohub-docker-vocabs.git | |
# skohub/skohub-vocabs-docker:latest | |
# - name: Deploy | |
# uses: peaceiris/actions-gh-pages@v3 | |
# with: | |
# github_token: ${{ secrets.GITHUB_TOKEN }} | |
# publish_dir: ./public |