Update codegen_harness.sh #7
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: Validate Codegen Harness | |
| on: | |
| workflow_dispatch: {} | |
| pull_request: | |
| paths: | |
| - "assets/specs/openapi/**/*.yml" | |
| - "assets/specs/openapi/**/*.yaml" | |
| - "scripts/codegen_harness.sh" | |
| - ".github/workflows/validate-codegen.yml" | |
| push: | |
| paths: | |
| - "assets/specs/openapi/**/*.yml" | |
| - "assets/specs/openapi/**/*.yaml" | |
| - "scripts/codegen_harness.sh" | |
| - ".github/workflows/validate-codegen.yml" | |
| jobs: | |
| harness: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Setup Python (for possible future checks) | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install CLI tools (Prism, OpenAPI Generator, jq/yq) | |
| run: | | |
| npm i -g @stoplight/prism-cli@5 @openapitools/openapi-generator-cli@2 | |
| sudo apt-get update | |
| sudo apt-get install -y jq | |
| VERSION=$(curl -sL https://api.github.com/repos/mikefarah/yq/releases/latest | jq -r '.tag_name' | tr -d 'v') | |
| curl -L "https://github.com/mikefarah/yq/releases/download/v${VERSION}/yq_linux_amd64" -o yq && chmod +x yq && sudo mv yq /usr/local/bin/yq | |
| echo "node $(node -v)"; echo "npm $(npm -v)"; prism --version; openapi-generator-cli version; yq --version; jq --version | |
| - name: Run Codegen Harness | |
| run: | | |
| bash scripts/codegen_harness.sh | |
| - name: Upload harness logs (always) | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: codegen-harness-logs | |
| path: .harness_logs/** |