Feat/25 clean up workflow and schema #26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: validate_json | |
on: | |
workflow_call: | |
inputs: | |
should_download: | |
description: "Download JSON artifacts if called by another workflow?" | |
type: boolean | |
outputs: | |
is_valid: | |
description: "Is the JSON valid?" | |
value: ${{ jobs.validate.outputs.is_valid}} | |
pull_request: | |
branches: ["*"] | |
workflow_dispatch: | |
jobs: | |
validate: | |
runs-on: ubuntu-latest | |
outputs: | |
is_valid: ${{ steps.save_state.outputs.is_valid}} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download JSON artifacts # if called by another workflow | |
if: ${{ inputs.should_download }} | |
uses: actions/download-artifact@v4 | |
with: | |
name: json-files | |
path: json | |
- name: Verify JSON artifacts directory | |
if: ${{ inputs.should_download }} | |
run: | | |
echo "Current working directory: $(pwd)" | |
ls -la | |
ls -la json | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
cache: "pip" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install -e . | |
- name: Run validate_yaml.py | |
run: python scripts/validate_yaml.py ./schema.json json | |
- name: Save state | |
id: save_state | |
if: steps.validate_json.conclusion == 'success' | |
run: echo "is_valid=true" >> $GITHUB_OUTPUT |