Merge pull request #249 from Dymerz/ptu #22
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 global.ini | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- ptu | |
pull_request: | |
branches: | |
- main | |
- ptu | |
jobs: | |
prepare: | |
name: Prepare environment | |
runs-on: ubuntu-latest | |
outputs: | |
changed-files: ${{ steps.changed-files.outputs.all_changed_files }} | |
changed-files-count: ${{ steps.changed-files.outputs.all_changed_files_count }} | |
steps: | |
- name: Checkout current repository | |
uses: actions/checkout@v3 | |
- name: Get all "global.ini" files that have changed | |
id: changed-files | |
uses: tj-actions/changed-files@v39 | |
with: | |
files: "data/Localization/*/global.ini" | |
separator: "\" \"" | |
- name: List all changed files | |
run: echo "Changed files ${{ steps.changed-files.outputs.all_changed_files }}" | |
validate-encoding: | |
name: Validate global.ini Encoding | |
runs-on: ubuntu-latest | |
needs: prepare | |
steps: | |
- name: Checkout current repository | |
if: needs.prepare.outputs.changed-files-count > 0 | |
uses: actions/checkout@v3 | |
- name: Validate encoding | |
if: needs.prepare.outputs.changed-files-count > 0 | |
run: bash tools/validate-encoding.bash "${{ needs.prepare.outputs.changed-files }}" | |
validate-entries: | |
name: Validate global.ini Entries | |
runs-on: ubuntu-latest | |
needs: prepare | |
if: needs.prepare.outputs.changed-files-count > 0 | |
steps: | |
- name: Checkout current repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install dependencies | |
uses: chill-viking/[email protected] | |
with: | |
working_directory: tools/ini-utils | |
- name: Build ini-utils | |
working-directory: tools/ini-utils | |
run: npm run build | |
- name: Validate key/value pairs | |
run: node ./tools/ini-utils/dist/src/index.js validate --ci "$GITHUB_WORKSPACE/data/Localization/english/global.ini" "${{ needs.prepare.outputs.changed-files }}" |