Files
CI-templates/.gitea/workflows/web/formatting.yml
T
Brian Bjarke Jensen 243a5432d8
Test CI Templates / validate-syntax (push) Successful in 11s
Test CI Templates / test-python-code-quality (3.11) (push) Failing after 5s
Test CI Templates / test-python-pytest (true, 3.12) (push) Failing after 4s
Test CI Templates / test-web-formatting (true, false, 20) (push) Failing after 5s
Test CI Templates / test-python-code-quality (3.10) (push) Failing after 5s
Test CI Templates / test-python-code-quality (3.12) (push) Failing after 5s
Test CI Templates / test-python-code-quality (false, false, basic) (push) Failing after 5s
Test CI Templates / test-python-code-quality (false, true, skip-pyupgrade) (push) Failing after 5s
Test CI Templates / test-python-pytest (false, 3.11) (push) Failing after 5s
Test CI Templates / test-python-pytest (false, 3.12) (push) Failing after 5s
Test CI Templates / test-python-pytest (true, 3.11) (push) Failing after 5s
Test CI Templates / test-web-formatting (false, false, 20) (push) Failing after 5s
Test CI Templates / test-web-formatting (false, true, 18) (push) Failing after 5s
Test CI Templates / test-web-formatting (false, true, 20) (push) Failing after 5s
Test CI Templates / test-web-formatting (true, false, 18) (push) Failing after 5s
Test CI Templates / test-monorepo (push) Failing after 5s
Test CI Templates / test-web-formatting (true, true, 18) (push) Failing after 5s
Test CI Templates / test-web-formatting (true, true, 20) (push) Failing after 5s
Test CI Templates / test-results (push) Successful in 2s
Test CI Templates / test-python-code-quality (true, false, skip-mypy) (push) Failing after 5s
Test CI Templates / test-web-formatting (false, false, 18) (push) Failing after 5s
Test CI Templates / test-edge-cases (push) Failing after 5s
fixed tests
2025-09-19 20:25:51 +02:00

94 lines
2.5 KiB
YAML

---
name: Web/General Formatting Pipeline
"on":
workflow_call:
inputs:
working-directory:
description: 'Working directory for the project'
required: false
type: string
default: "."
node-version:
description: 'Node.js version to use for prettier (e.g., "20")'
required: false
type: string
default: "20"
skip-prettier:
description: 'Skip prettier formatting check'
required: false
type: boolean
default: false
prettier-config:
description: 'Path to prettier config file (optional)'
required: false
type: string
default: ""
check-yaml:
description: 'Check YAML files with yamllint'
required: false
type: boolean
default: false
check-json:
description: 'Check JSON files for validity'
required: false
type: boolean
default: false
python-version:
description: 'Python version to use for YAML linting (e.g., "3.12")'
required: false
type: string
default: "3.12"
jobs:
formatting:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ inputs.working-directory }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
if: ${{ !inputs.skip-prettier }}
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
- name: Install prettier
if: ${{ !inputs.skip-prettier }}
run: npm install --save-dev --save-exact prettier
- name: Run prettier check
if: ${{ !inputs.skip-prettier }}
run: |
if [ -n "${{ inputs.prettier-config }}" ]; then
npx prettier --check . --config ${{ inputs.prettier-config }}
else
npx prettier --check .
fi
- name: Set up Python for YAML linting
if: ${{ inputs.check-yaml }}
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- name: Install yamllint
if: ${{ inputs.check-yaml }}
run: pip install yamllint
- name: Check YAML files
if: ${{ inputs.check-yaml }}
run: yamllint .
- name: Check JSON files
if: ${{ inputs.check-json }}
run: |
find . -name "*.json" -type f | while read -r file; do
echo "Checking $file"
python -m json.tool "$file" > /dev/null
done