diff --git a/.github/workflows/manifest-check.yml b/.github/workflows/manifest-check.yml new file mode 100644 index 0000000..b84d4b4 --- /dev/null +++ b/.github/workflows/manifest-check.yml @@ -0,0 +1,31 @@ +name: Manifest check +on: [workflow_call] # allow this workflow to be called from other workflows + +jobs: + check-for-tabs-in-json: + name: Check for tabulations + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Check JSON files for tabs + run: | + set -e + + for file in $(find . -type f -name '*.json'); do + if grep --perl-regexp --quiet '\t' "$file"; then + echo "Error: JSON file $file contains tabs." + exit 1 + fi + done + + verify-json-validation: + name: Run JSON schema validation + needs: check-for-tabs-in-json + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Validate package.json against local schema + uses: cardinalby/schema-validator-action@v3 + with: + file: 'verified-mods.json' + schema: '.github/schema.json' diff --git a/.github/workflows/mods-verification.yml b/.github/workflows/mods-verification.yml new file mode 100644 index 0000000..6d44288 --- /dev/null +++ b/.github/workflows/mods-verification.yml @@ -0,0 +1,16 @@ +name: Mods verification +on: [workflow_call] # allow this workflow to be called from other workflows + +jobs: + verify-mods-versions: + name: Try and fetch mod versions + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup python + uses: actions/setup-python@v5 + with: + python-version: 3.11 + - name: Run mod checks + run: | + python .github/verify_versions.py diff --git a/.github/workflows/no-tabs.yml b/.github/workflows/no-tabs.yml deleted file mode 100644 index b7732d7..0000000 --- a/.github/workflows/no-tabs.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Check for tabs in JSON files - -on: [push, pull_request] - -jobs: - check-for-tabs-in-json: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Check JSON files for tabs - run: | - set -e - - for file in $(find . -type f -name '*.json'); do - if grep --perl-regexp --quiet '\t' "$file"; then - echo "Error: JSON file $file contains tabs." - exit 1 - fi - done diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml deleted file mode 100644 index db0631c..0000000 --- a/.github/workflows/validate.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Validate JSONs - -on: [push, pull_request] - -jobs: - verify-json-validation: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Validate package.json against local schema - uses: cardinalby/schema-validator-action@v3 - with: - file: 'verified-mods.json' - schema: '.github/schema.json' - verify-mods-versions: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Setup python - uses: actions/setup-python@v5 - with: - python-version: 3.11 - - name: Run mod checks - run: | - python .github/verify_versions.py diff --git a/.github/workflows/verified-mods.yml b/.github/workflows/verified-mods.yml new file mode 100644 index 0000000..4f2599f --- /dev/null +++ b/.github/workflows/verified-mods.yml @@ -0,0 +1,11 @@ +name: VerifiedMods +on: [push, pull_request] + +jobs: + manifest-checking: + name: Manifest check + uses: ./.github/workflows/manifest-check.yml + mods-verification: + name: Mod verification + needs: [manifest-checking] + uses: ./.github/workflows/mods-verification.yml