Skip to content

Add HTI model 291; adjust metadata schema; allow failed CFF validation to error #15

Add HTI model 291; adjust metadata schema; allow failed CFF validation to error

Add HTI model 291; adjust metadata schema; allow failed CFF validation to error #15

name: Validate metadata
on:
push:
paths:
- '**metadata.ya?ml'
pull_request:
workflow_dispatch:
jobs:
list-metadata-files:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.file-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- id: file-matrix
run: |
echo "matrix=$(find -iname metadata.yaml | jq -Rsc 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
yamale-validate:
needs: list-metadata-files
runs-on: ubuntu-latest
strategy:
matrix:
metadata-file: ${{ fromJSON(needs.list-metadata-files.outputs.matrix) }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Yamale
run: "pip install yamale"
- name: Install ruamel
run: |
pip install ruamel.yaml \
pip install ruamel.yaml.cmd
- name: Run Yamale
run: |
yamale -s ./test/metadata_schema.yaml -p ruamel ${{ matrix.metadata-file }}
# cff-validate:
# needs: list-metadata-files
# runs-on: ubuntu-latest
# strategy:
# matrix:
# metadata-file: ${{ fromJSON(needs.list-metadata-files.outputs.matrix) }}
#
# steps:
# - name: Validate citation
# uses: dieghernan/cff-validator@v3