-
Notifications
You must be signed in to change notification settings - Fork 81
47 lines (46 loc) · 1.32 KB
/
openapi-spec.yml
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
44
45
46
47
# SPDX-License-Identifier: Apache-2.0
# Copyright 2022 The HuggingFace Authors.
name: Check openapi specification
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "docs/source/openapi.json"
- ".github/workflows/openapi.yml"
pull_request:
paths:
- "docs/source/openapi.json"
- ".github/workflows/openapi.yml"
env:
python-version: 3.9.15
poetry-version: "1.4.2"
# required to get access to use a cached poetry venv in "/home/runner/.cache/pypoetry/virtualenvs"
POETRY_VIRTUALENVS_IN_PROJECT: false
working-directory: e2e
jobs:
check-openapi-spec:
defaults:
run:
shell: bash
working-directory: e2e
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry==${{ env.poetry-version }}
- name: Use Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.python-version }}
cache: "poetry"
cache-dependency-path: |
${{ env.working-directory }}/poetry.lock
- name: Install dependencies
run: |
poetry env use "${{ env.python-version }}"
poetry install
- name: Check openapi spec
run: |
poetry run python -m openapi_spec_validator ../docs/source/openapi.json