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

ci: Reorganize workflows #29

Merged
merged 10 commits into from
Jan 29, 2024
31 changes: 31 additions & 0 deletions .github/workflows/manifest-check.yml
Original file line number Diff line number Diff line change
@@ -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'
16 changes: 16 additions & 0 deletions .github/workflows/mods-verification.yml
Original file line number Diff line number Diff line change
@@ -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
19 changes: 0 additions & 19 deletions .github/workflows/no-tabs.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/validate.yml

This file was deleted.

11 changes: 11 additions & 0 deletions .github/workflows/verified-mods.yml
GeckoEidechse marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: VerifiedMods
on: [push, pull_request]

jobs:
manifest-checking:
name: Manifest check
uses: ./.github/workflows/manifest-check.yml
GeckoEidechse marked this conversation as resolved.
Show resolved Hide resolved
mods-verification:
name: Mod verification
needs: [manifest-checking]
uses: ./.github/workflows/mods-verification.yml
Loading