-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Isolate api as a standalone component in this monorepo
Signed-off-by: Michael Shen <[email protected]>
- Loading branch information
Showing
4 changed files
with
23 additions
and
17 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,39 +7,44 @@ on: | |
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- 'api/**' | ||
- 'package.json' | ||
- 'package-lock.json' | ||
|
||
jobs: | ||
typescript_api_spec_validation: | ||
permissions: | ||
contents: 'read' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 | ||
with: | ||
fetch-depth: 1 | ||
sparse-checkout: 'api' | ||
sparse-checkout-cone-mode: false | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@c2ac33f2c62f978d6c944d9648125a294e56dc0b # v4.0.2 | ||
with: | ||
node-version: 'v20.12.0' | ||
|
||
- name: Install tsp | ||
run: npm install -g @typespec/[email protected] | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
run: npm ci | ||
|
||
- name: Install autorest | ||
- name: Install autorest | ||
run: npm install -g [email protected] | ||
|
||
- name: Compile tsp | ||
run: tsp compile ./api/redhatopenshift/HcpCluster --warn-as-error | ||
|
||
- name: Generate OpenAPI | ||
run: autorest api/autorest-config.yaml | ||
|
||
- name: make generate | ||
run: make generate | ||
working-directory: './api' | ||
|
||
- name: Check for Uncommitted Changes | ||
run: | | ||
git diff --exit-code || (echo "::error::Uncommitted changes detected in OpenAPI spec. Please regenerate and commit them." && exit 1) | ||
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
SHELL = /bin/bash | ||
|
||
.PHONY: generate | ||
generate: | ||
tsp compile redhatopenshift/HcpCluster --warn-as-error | ||
autorest autorest-config.yaml |