Adjust metadata schema validation action #2
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: 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 |