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 2, 2024
1 parent 41f5cd8 commit 07ecfec
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/schemas.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "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: Test schemas
runs-on: ubuntu-latest

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

- name: Test schemas
run: |
cat RakeFile
bundle install
bundle exec schemas:test
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ task default: %i[spec rubocop]
require "yard"

YARD::Rake::YardocTask.new

load "lib/tasks/test_schemas.rake"
11 changes: 11 additions & 0 deletions lib/tasks/test_schemas.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require "expressir"

namespace :schemas do
desc "Test iso-10303 schemas"
task :test do
Dir.glob("iso-10303/schemas/{resources,modules}/**/*.exp").each do |file|
puts "Testing #{file}"
::Expressir::Express::Parser.from_file(File.new(file))
end
end
end

0 comments on commit 07ecfec

Please sign in to comment.