Skip to content

Add schema definition #17

Add schema definition

Add schema definition #17

Workflow file for this run

name: PR checks fon algorithm submission
on:
pull_request:
paths:
- 'algorithms/*.yaml'
push:
paths:
- 'algorithms/*.yaml'
jobs:
check_yaml:
runs-on: ubuntu-latest
container:
image: ${{ github.repository }}-algo-checks
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
steps:
- name: find algorithm files
run: |
{
echo 'FILELIST<<EOF'
find ./algorithms -name '*.yaml' -print
echo EOF
} >> "$GITHUB_ENV"
- name: Convert and validate using jsonschema
run: |
for algo in ${FILELIST}; do
yq -o json $algo > algo.json \
&& jsonschema-cli -i algo.json "config/schema.json"
done
rm algo.json
check_image:
runs-on: ubuntu-latest
steps:
- name: find algorithm files
run: |
{
echo 'FILELIST<<EOF'
find ./algorithms -name '*.yaml' -print
echo EOF
} >> "$GITHUB_ENV"
- name: Pull image
run: |
for algo in ${FILELIST}; do
docker pull $(sed 's/^image: \+\(.*\)$/\1/' $algo)
done