Add analysis result to backtest result schema (#2253) #13
This file contains hidden or 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: "Lint OpenAPI spec with vacuum" | |
| on: | |
| push: | |
| paths: | |
| - 'QuantConnect-Platform-2.0.0.yaml' | |
| pull_request: | |
| paths: | |
| - 'QuantConnect-Platform-2.0.0.yaml' | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| vacuum-lint: | |
| name: Run OpenAPI linting with vacuum | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Lint OpenAPI specification using vacuum | |
| id: lint | |
| shell: bash | |
| env: | |
| DOCKER_BUILDKIT: 1 | |
| OPENAPI_PATH: "QuantConnect-Platform-2.0.0.yaml" | |
| SHOW_RULES: "false" | |
| MINIMUM_SCORE: "10" | |
| FAIL_ON_ERROR: "true" | |
| RULESET: "" | |
| PRINT_LOGS: "true" | |
| GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} | |
| run: | | |
| args=( lint --pipeline-output "$OPENAPI_PATH" ) | |
| # --min-score <value> | |
| args+=( --min-score "$MINIMUM_SCORE" ) | |
| # --fail-severity none|error | |
| if [ "$FAIL_ON_ERROR" = "true" ]; then | |
| args+=( --fail-severity error ) | |
| else | |
| args+=( --fail-severity none ) | |
| fi | |
| # --show-rules only if show_rules == "true" | |
| if [ "$SHOW_RULES" = "true" ]; then | |
| args+=( --show-rules ) | |
| fi | |
| # optional ruleset | |
| if [ -n "$RULESET" ]; then | |
| args+=( --ruleset "$RULESET" ) | |
| fi | |
| CMD=( docker run --rm \ | |
| -v "$GITHUB_WORKSPACE":/work:ro \ | |
| dshanley/vacuum "${args[@]}" ) | |
| echo "Running: ${CMD[*]}" | |
| report=$("${CMD[@]}") | |
| REPORT_FILE="$GITHUB_WORKSPACE/vacuum-lint-report.md" | |
| { | |
| echo "<!-- vacuum-lint-report -->" | |
| echo | |
| echo "$report" | |
| } > "$REPORT_FILE" | |
| # print logs to console if enabled | |
| if [ "$PRINT_LOGS" = "true" ]; then | |
| cat "$REPORT_FILE" | |
| fi | |
| echo "report_path=vacuum-lint-report.md" >> "$GITHUB_OUTPUT" |