Skip to content

Commit

Permalink
Add GHA job to test against all iso-10303 schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
kwkwan committed Dec 3, 2024
1 parent 41f5cd8 commit 79670e9
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
49 changes: 49 additions & 0 deletions .github/workflows/validate_schemas.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: "validate_schemas"

on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:

concurrency:
group: '${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name }}'
cancel-in-progress: true

jobs:
schemas:
name: Validate schemas
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test-group:
[
'iso-10303/schemas-srl.yml',
'iso-10303/schemas_module.yml',
'iso-10303/schemas_bom.yml',
]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Checkout
uses: actions/checkout@v4
with:
repository: 'metanorma/iso-10303'
path: iso-10303
token: ${{ secrets.LUTAML_CI_PAT_TOKEN }}

- name: Install Ruby
uses: ruby/setup-ruby@master
with:
ruby-version: 3.2
bundler-cache: true
cache-version: 0 # Increment this number if you need to re-download cached gems

- name: Validate schemas ${{ matrix.test-group }}
run: |
ls -l
yq '.schemas[].path | sub("../../iso-10303/", "")' ${{ matrix.test-group }} | xargs bundle exec ./exe/expressir validate
3 changes: 2 additions & 1 deletion lib/expressir/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ def validate(*paths) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
no_valid = []

paths.each do |path|
puts "Validating #{path}"
x = Pathname.new(path).realpath.relative_path_from(Dir.pwd)
puts "Validating #{x}"
puts "Validating realpath #{x}"
ret = _validate_schema(path)

if ret.nil?
Expand Down

0 comments on commit 79670e9

Please sign in to comment.