-
Notifications
You must be signed in to change notification settings - Fork 2
53 lines (45 loc) · 1.27 KB
/
validate-metadata.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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