Skip to content

Commit

Permalink
Merge pull request #6 from mhpob/yamale
Browse files Browse the repository at this point in the history
Add VR2 x VR2PC file and metadata; validate YAML metadata using Yamale
  • Loading branch information
jdpye authored Mar 26, 2024
2 parents 01c15b9 + 45d8360 commit 1915d34
Show file tree
Hide file tree
Showing 5 changed files with 1,022 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/validate-metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.Rproj.user
.Rhistory
.RData
.Ruserdata
*.Rproj
Loading

0 comments on commit 1915d34

Please sign in to comment.