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

Add GitHub Actions to validate schemas #54

Merged
merged 3 commits into from
Dec 16, 2021

Conversation

AntoineAugusti
Copy link
Contributor

This PR adds a very simple GitHub Actions script to validate JSON Schemas file using jsonschema in Python.

Example output: https://github.com/AntoineAugusti/gbfs-json-schema/runs/4081742347?check_suite_focus=true

The goal is to catch potential errors when doing PRs.

@CLAassistant
Copy link

CLAassistant commented Nov 2, 2021

CLA assistant check
All committers have signed the CLA.

with:
python-version: '3.x'
- name: Install jsonschema
run: pip install jsonschema==3.2.0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't manage to run this using the latest jsonschema version on my machine or on GitHub Actions

Looking at releases and issues it seems like the v4 is not mature enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used a straightforward pip install here instead of adding a requirements.txt etc. Let me know if you're okay with that.

@isabelle-dr
Copy link
Contributor

Hi @AntoineAugusti, thanks for this contribution!
We are changing the structure of this repo to organise the versions per folder instead of releases.
Is this GitHub action still going to work?

- name: Install jsonschema
run: pip install jsonschema==3.2.0
- run: |
for i in *.json; do
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might work with the new repo structure if this line is changed to

for i in **/*.json; do

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in 2a30b2c

change the logic to have this action forking with current repo structure
@isabelle-dr isabelle-dr merged commit b871a0e into MobilityData:master Dec 16, 2021
@AntoineAugusti
Copy link
Contributor Author

Thanks! This should catch simple mistakes.

@AntoineAugusti AntoineAugusti deleted the gh-actions-test branch December 16, 2021 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants