Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tests.yml #218

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 24 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# This workflow will validate the mzQC example files against the JSON schema.

name: tests

env:
# folder path only; file name and extension wild cards get added in-use
PATH_TO_EXAMPLES: ./specification_documents/examples

on:
push:
branches: [ main ]
branches: [ main, ci_test_validate ]
pull_request:
branches: [ main ]
branches: [ main, ci_test_validate ]
schedule:
- cron: "0 0 1 1/1 *" # Run monthly.

Expand All @@ -19,16 +22,28 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install jsonschema
- name: Validate mzQC files
pip install jsonschema check-jsonschema click
pip install -U git+https://github.com/MS-Quality-hub/[email protected]
- name: Syntactic Validatation of Example mzQC Files
run: |
for i in $PATH_TO_EXAMPLES/*.mz[qQ][cC]; do
echo "Syntactic Validation of $i"
#jsonschema -i $i ./schema/mzqc_schema.json
check-jsonschema --schemafile ./schema/mzqc_schema.json $i
if [ $? -ne 0 ]; then
echo "Failed to validate $i"
exit 1
fi
done
- name: Semantic Validatation of Example mzQC Files
run: |
for i in ./specification_documents/examples/*.mz[qQ][cC]; do
echo "Syntactic validating of $i"
jsonschema -i $i ./schema/mzqc_schema.json
for i in $PATH_TO_EXAMPLES/*.mz[qQ][cC]; do
echo "Semantic Validation of $i"
mzqc-validator $i
if [ $? -ne 0 ]; then
echo "Failed to validate $i"
exit 1
Expand Down
Loading