action.yaml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. name: Compatibility Data Validator
  2. description: Checks Windows compatibility data files
  3. inputs:
  4. repositorySecret:
  5. description: GitHub token for API access
  6. required: true
  7. workingDirectory:
  8. description: Working directory for checks
  9. required: false
  10. default: ${{ github.workspace }}
  11. runs:
  12. using: composite
  13. steps:
  14. - name: Check Runner Operating System 🏃‍♂️
  15. if: runner.os == 'Windows'
  16. shell: bash
  17. run: |
  18. : Check Runner Operating System 🏃‍♂️
  19. echo "services-validation action requires a macOS-based or Linux-based runner."
  20. exit 2
  21. - name: Install and Configure Python 🐍
  22. shell: bash
  23. run: |
  24. : Install and Configure Python 🐍
  25. if [[ "${RUNNER_DEBUG}" ]]; then set -x; fi
  26. echo ::group::Python Set Up
  27. if [[ "${RUNNER_OS}" == Linux ]]; then
  28. eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
  29. echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
  30. fi
  31. brew install --quiet python3
  32. python3 -m venv .venv
  33. source .venv/bin/activate
  34. python3 -m pip install jsonschema json_source_map
  35. echo ::endgroup::
  36. - name: Validate Compatibility Files JSON Schema 🕵️
  37. shell: bash
  38. working-directory: ${{ inputs.workingDirectory }}
  39. run: |
  40. : Validate services file JSON schema 🕵️
  41. if [[ "${RUNNER_DEBUG}" ]]; then set -x; fi
  42. shopt -s extglob
  43. echo ::group::Schema Validation
  44. source .venv/bin/activate
  45. python3 -u \
  46. .github/scripts/utils.py/check-jsonschema.py \
  47. --loglevel INFO \
  48. plugins/win-capture/data/@(compatibility|package).json
  49. echo ::endgroup::
  50. - name: Annotate Schema Validation Errors 🏷️
  51. uses: yuzutech/annotations-action@0e061a6e3ac848299310b6429b60d67cafd4e7f8
  52. if: failure()
  53. with:
  54. repo-token: ${{ inputs.repositorySecret }}
  55. title: Compatibility JSON Errors
  56. input: ${{ inputs.workingDirectory }}/validation_errors.json