Validate data #901
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
# SPDX-FileCopyrightText: © 2023 Kevin Lu | |
# SPDX-Licence-Identifier: AGPL-3.0-or-later | |
name: Validate data | |
on: | |
push: | |
branches: [master] | |
paths: | |
- .github/workflows/validate-data.yaml | |
- data/** | |
- src/test_data_validation.py | |
- src/assignments/check-for-missing.ts | |
pull_request: | |
paths: | |
- .github/workflows/validate-data.yaml | |
- data/** | |
- src/test_data_validation.py | |
- src/assignments/check-for-missing.ts | |
workflow_dispatch: | |
jobs: | |
validate: | |
name: Validate data | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: yarn | |
- run: yarn | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
cache: pip | |
- run: pip install -r src/requirements.txt | |
- name: Does not contain wikitext templates | |
run: | | |
! grep {{ -R data --include='*.yaml' | |
- name: Rush Duel data conforms to schema | |
if: success() || failure() | |
# Generated from https://github.com/DawnbrandBots/api-v8-definitions/blob/master/rush.ts | |
run: | | |
curl -fsSLo RushCardSchema.json '${{ secrets.RUSH_CARD_SCHEMA_URL }}' | |
python src/test_data_validation.py RushCardSchema.json data/rush | |
- name: OCG/TCG data conforms to schema | |
if: success() || failure() | |
# Generated from https://github.com/DawnbrandBots/api-v8-definitions/blob/master/index.ts | |
run: | | |
curl -fsSLo CardSchema.json '${{ secrets.CARD_SCHEMA_URL }}' | |
python src/test_data_validation.py CardSchema.json data/cards | |
- name: Cards are not missing placeholder fake passwords | |
if: success() || failure() | |
run: yarn check-for-missing-fake-password data/cards | |
# The following steps will not fail the workflow until yaml-yugi-ko is fully setup | |
- name: OCG cards are all translated into Korean | |
if: success() || failure() | |
run: yarn check-for-missing-ko-translation data/cards || true | |
- name: Rush Duel cards are all translated into Korean | |
if: success() || failure() | |
run: yarn check-for-missing-ko-translation data/rush || true |