Generate Java API Client for Intelligence Service's OpenAPI Specifications #16
Workflow file for this run
This file contains 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: OpenAPI intelligence service | |
on: | |
pull_request: | |
types: [opened, synchronize, labeled, reopened] | |
paths: | |
- 'server/application-server/**' | |
- '.github/workflows/generate-intelligence-service-client.yml' | |
push: | |
paths: | |
- 'server/intelligence-service/openapi.yaml' | |
- 'server/application-server/src/main/java/de/tum/in/www1/hephaestus/intelligenceservice/**' | |
branches: [develop] | |
workflow_dispatch: | |
jobs: | |
generate-api-client: | |
name: Verify API Specs and Client of the intelligence service (add autocommit-openapi label to PR to auto-commit changes) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.12 | |
- name: Install dependencies | |
run: npm install | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '21' | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
virtualenvs-path: .venv | |
installer-parallel: true | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v4 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Install Python dependencies | |
working-directory: server/intelligence-service | |
run: poetry install --no-interaction --no-root | |
- name: Generate API client for the intelligence service | |
working-directory: server/intelligence-service | |
run: poetry run npm run generate:api:intelligence-service |