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

Test json #9

Open
wants to merge 7 commits into
base: super-linter
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/actions/ci-tool-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: 'Setup CI Tools'
description: 'Setup various toolsets for use in CI workflows.'
inputs:
xmake:
description: 'Install xmake'
default: true
outputs:
random-number:
description: "Random number"
value: ${{ steps.random-number-generator.outputs.random-number }}
runs:
using: "composite"
steps:
# Force xmake to a specific folder (for cache)
- name: Set xmake env
run: echo "XMAKE_GLOBALDIR=${{ runner.tool_cache }}/xmake-global" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
shell: powershell

- name: Install VS2022 BuildTools 17.9.7
run: choco install -y visualstudio2022buildtools --version=117.9.7.0 --params "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --installChannelUri https://aka.ms/vs/17/release/180911598_-255012421/channel"
shell: powershell

- name: Setup xmake
uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: '2.9.2'

- name: Update xmake repository
run: xmake repo --update
shell: powershell

# Fetch xmake dephash
- name: Retrieve dependencies hash
id: dep_hash
run: echo "hash=$(xmake l utils.ci.packageskey)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
shell: powershell

# Cache xmake dependencies
- name: Restore cached xmake dependencies
id: restore-depcache
uses: actions/cache/restore@v4
with:
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
# Example key: MSVC-Game__Shipping__Win64-42d5ac22284a460e96b6cab018d6b7b5-W23
key: MSVC-${{ inputs.build-mode }}-${{ steps.dep_hash.outputs.hash }}-W${{ steps.cache_key.outputs.key }}

48 changes: 48 additions & 0 deletions .github/actions/xmake-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: 'Setup xmake'
description: 'Setup xmake for use in CI scripts'
inputs:
version:
description: 'xmake version to install'
required: true
package-cache-key:
description: 'cache key'

outputs:
random-number:
description: "Random number"
value: ${{ steps.random-number-generator.outputs.random-number }}
runs:
using: "composite"
steps:
# Force xmake to a specific folder (for cache)
- name: Set xmake env
run: echo "XMAKE_GLOBALDIR=${{ runner.tool_cache }}/xmake-global" >> $GITHUB_OUTPUT
shell: bash

- name: Install VS2022 BuildTools 17.9.7
run: choco install -y visualstudio2022buildtools --version=117.9.7.0 --params "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --installChannelUri https://aka.ms/vs/17/release/180911598_-255012421/channel"
shell: powershell

- name: Setup xmake
uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: '2.9.2'

- name: Update xmake repository
run: xmake repo --update
shell: powershell

# Fetch xmake dephash
- name: Retrieve dependencies hash
id: dep_hash
run: echo "hash=$(xmake l utils.ci.packageskey)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
shell: powershell

# Cache xmake dependencies
- name: Restore cached xmake dependencies
id: restore-depcache
uses: actions/cache/restore@v4
with:
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
# Example key: MSVC-Game__Shipping__Win64-42d5ac22284a460e96b6cab018d6b7b5-W23
key: MSVC-${{ inputs.build-mode }}-${{ steps.dep_hash.outputs.hash }}-W${{ steps.cache_key.outputs.key }}
17 changes: 17 additions & 0 deletions .github/problem-matchers/actionlint-matcher.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"problemMatcher": [
{
"owner": "actionlint",
"pattern": [
{
"regexp": "^(?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*: (?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)* \\[(.+?)\\]$",
"file": 1,
"line": 2,
"column": 3,
"message": 4,
"code": 5
}
]
}
]
}
21 changes: 21 additions & 0 deletions .github/problem-matchers/jsonlint-matcher.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"problemMatcher": [
{
"owner": "jsonlint",
"pattern": [
{
"regexp": "^(.*[\\/\\\\])?([.\\w\\-_]*)$",
"fromPath": 1,
"file": 2
},
{
"regexp": "^jq:\\sparse\\serror:\\s(.*)\\sat\\sline\\s(\\d*),\\scolumn\\s(\\d*)$",
"message": 1,
"line": 2,
"column": 3,
"loop": true
}
]
}
]
}
33 changes: 33 additions & 0 deletions .github/workflows/json-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Validate JSON Files
on:
pull_request:
paths:
- "**.json"
push:
jobs:
jsonlint:
runs-on: ubuntu-latest
steps:
- name: Checkout the Repository
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.UEPSEUDO_PAT }}
- name: Get all changed JSON files
id: changed-json-files
uses: tj-actions/changed-files@v44
with:
files: |
**.json
- name: Lint all changed JSON files
if: steps.changed-json-files.outputs.any_changed == 'true'
shell: bash
env:
ALL_CHANGED_FILES: ${{ steps.changed-json-files.outputs.all_changed_files }}
run: |
echo "::add-matcher::.github/problem-matchers/jsonlint-matcher.json"
for file in ${ALL_CHANGED_FILES}; do
echo "$file"
jq . "$file" 1> /dev/null
done

7 changes: 3 additions & 4 deletions .github/workflows/pushdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v4
us actions/setup-python@v4

Check failure on line 19 in .github/workflows/pushdocs.yml

View workflow job for this annotation

GitHub Actions / actionlint

could not parse as YAML: yaml: line 19: could not find expected ':'

Check failure on line 19 in .github/workflows/pushdocs.yml

View workflow job for this annotation

GitHub Actions / actionlint

could not parse as YAML: yaml: line 19: could not find expected ':'

Check failure on line 19 in .github/workflows/pushdocs.yml

View workflow job for this annotation

GitHub Actions / actionlint

could not parse as YAML: yaml: line 19: could not find expected ':'

Check failure on line 19 in .github/workflows/pushdocs.yml

View workflow job for this annotation

GitHub Actions / actionlint

could not parse as YAML: yaml: line 19: could not find expected ':'
with:
python-version: '3.x'

Expand All @@ -32,8 +32,7 @@
python docs-repo/build.py

- uses: actions/upload-pages-artifact@v1
with:
path: docs-repo/docs
wit
deploy:
needs: build

Expand All @@ -43,7 +42,7 @@

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
url: ${{ stepss.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/workflow-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Validate GitHub Workflow Files
on:
pull_request:
branches: ['main']
paths:
- ".github/**"
jobs:
actionlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check workflow files
run: |
echo "::add-matcher::.github/problem-matchers/actionlint-matcher.json"
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
./actionlint -color
shell: bash
2 changes: 1 addition & 1 deletion assets/Mods/mods.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
{
"mod_name": "SplitScreenMod",
"mod_enabled": false
},
}
{

Check failure on line 22 in assets/Mods/mods.json

View workflow job for this annotation

GitHub Actions / jsonlint

Expected separator between values

Check failure on line 22 in assets/Mods/mods.json

View workflow job for this annotation

GitHub Actions / jsonlint

Expected separator between values

Check failure on line 22 in assets/Mods/mods.json

View workflow job for this annotation

GitHub Actions / jsonlint

Expected separator between values

Check failure on line 22 in assets/Mods/mods.json

View workflow job for this annotation

GitHub Actions / jsonlint

Expected separator between values

Check failure on line 22 in assets/Mods/mods.json

View workflow job for this annotation

GitHub Actions / jsonlint

Expected separator between values

Check failure on line 22 in assets/Mods/mods.json

View workflow job for this annotation

GitHub Actions / jsonlint

Expected separator between values
"mod_name": "LineTraceMod",
"mod_enabled": true
},
Expand Down
Loading