Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isolate api as a standalone component in this monorepo #66

Merged
merged 1 commit into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"editorconfig.editorconfig",
"ms-azuretools.vscode-bicep",
"ms-vscode.azurecli",
"arjun.swagger-viewer"
"arjun.swagger-viewer",
"typespec.typespec-vscode"
],

"settings": {
Expand Down
23 changes: 13 additions & 10 deletions .github/workflows/api-lint.yml → .github/workflows/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ 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:
Expand All @@ -22,24 +28,21 @@ jobs:
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)


6 changes: 0 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,3 @@ deploy-frontend:

undeploy-frontend:
oc process -f ./deploy/aro-hcp-frontend.yml -p ARO_HCP_FRONTEND_IMAGE=${ARO_HCP_FRONTEND_IMAGE} | oc delete -f -

.PHONY: api
api:
tsp compile api/redhatopenshift/HcpCluster/
autorest api/autorest-config.yaml

6 changes: 6 additions & 0 deletions api/Makefile
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