Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/generate-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Cache API validation report

on:
push:
branches:
- main
- '[0-9]+.[0-9]+'

jobs:
generate-report:
name: generate-report
runs-on: ubuntu-latest

steps:
- 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/types-validator

- name: Install deps 2/2
working-directory: ./elasticsearch-specification
run: |
make setup

- name: Generate specification and check generated types
working-directory: ./elasticsearch-specification
run: |
make contrib

- name: Generate report
working-directory: ./clients-flight-recorder/scripts/types-validator
env:
BRANCH: ${{ github.ref_name }}
run: node index.js --generate-report --ci --branch $BRANCH

- name: Cache JSON report
id: cache-json-report
uses: actions/cache/save@v4
with:
path: ./clients-flight-recorder/recordings/types-validation/types-validation.json
key: types-validation-json-${{ github.sha }}
8 changes: 8 additions & 0 deletions .github/workflows/validate-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ jobs:
with:
node-version: 22

- name: Restore JSON report
id: restore-json-report
uses: actions/cache/restore@v4
with:
path: |
./clients-flight-recorder/recordings/types-validation/types-validation.json
key: types-validation-json-${{ github.event.pull_request.base.sha }}

- name: Install deps 1/2
working-directory: ./clients-flight-recorder
run: |
Expand Down