Adds custom inference service API docs #3902
Workflow file for this run
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 APIs | |
on: | |
pull_request: | |
branches: | |
- main | |
- '[0-9]+.[0-9]+' | |
jobs: | |
validate-pr: | |
name: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check pull request was opened from branch | |
if: github.event.pull_request.head.repo.full_name != 'elastic/elasticsearch-specification' | |
run: echo "Validation is not supported from forks"; exit 1 | |
- uses: actions/checkout@v4 | |
with: | |
path: ./elasticsearch-specification | |
- uses: actions/checkout@v4 | |
with: | |
repository: elastic/clients-flight-recorder | |
path: ./clients-flight-recorder | |
token: ${{ secrets.PAT }} | |
ref: main | |
- name: Use Node.js 22 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- name: Install deps 1/2 | |
working-directory: ./clients-flight-recorder | |
run: | | |
npm install --prefix scripts/clone-elasticsearch | |
npm install --prefix scripts/upload-recording | |
npm install --prefix scripts/types-validator | |
- name: Install deps 2/2 | |
working-directory: ./elasticsearch-specification | |
run: | | |
npm install --prefix .github/validate-pr | |
make setup | |
- name: Generate specification and check generated types | |
working-directory: ./elasticsearch-specification | |
run: | | |
make contrib | |
- name: Download artifacts | |
working-directory: ./clients-flight-recorder | |
run: | | |
if [[ -n "${GITHUB_BASE_REF+x}" ]]; then | |
branch=$GITHUB_BASE_REF | |
else | |
branch=$GITHUB_REF_NAME | |
fi | |
node scripts/upload-recording/download.js --branch $branch --git | |
node scripts/clone-elasticsearch/index.js --branch $branch | |
- name: Run validation | |
id: validation | |
working-directory: ./elasticsearch-specification | |
run: node .github/validate-pr --token ${{ secrets.GITHUB_TOKEN }} | |
- name: Find existing comment | |
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e # v3.1.0 | |
id: find-comment | |
with: | |
issue-number: ${{ github.event.pull_request.number }} | |
comment-author: 'github-actions[bot]' | |
body-includes: 'Following you can find the validation changes' | |
- name: Create or update comment | |
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
comment-id: ${{ steps.find-comment.outputs.comment-id }} | |
issue-number: ${{ github.event.pull_request.number }} | |
body: ${{ steps.validation.outputs.comment_body }} | |
edit-mode: replace |