Merge pull request #6 from mhpob/yamale #1
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: Validation | |
on: | |
push: | |
branches: [main, yamale] | |
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 "::set-output name=matrix::$(find -iname metadata.yaml | jq -Rsc 'split("\n")[:-1]')" | |
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" | |
- name: Run Yamale | |
run: | | |
yamale -s 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 |