-
Notifications
You must be signed in to change notification settings - Fork 65
43 lines (35 loc) · 1 KB
/
openapi-validate.yml
File metadata and controls
43 lines (35 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Validate OpenAPI Spec
on:
push:
paths:
- 'api-server/**'
pull_request:
paths:
- 'api-server/**'
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
api-server/target
key: ${{ runner.os }}-cargo-api-${{ hashFiles('api-server/Cargo.lock') }}
- name: Build api-server
working-directory: api-server
run: cargo build --release
- name: Start api-server and export spec
run: |
./api-server/target/release/api-server &
sleep 2
curl -sf http://localhost:8080/openapi.json -o openapi.json
- name: Install swagger-cli
run: npm install -g @apidevtools/swagger-cli
- name: Validate OpenAPI spec
run: swagger-cli validate openapi.json