change grpc to openapi #7
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: Basyx API Integration | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
test: | |
name: Gen open API | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: set up go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ">=1.17" | |
- name: retrieve api spec from swaggerhub | |
run: | | |
mkdir -p ./gen/source/ | |
BASYX_SWAGGER=https://api.swaggerhub.com/apis/BaSyx/basyx_asset_administration_shell_repository_http_rest_api/v1/swagger.yaml?resolved=true | |
curl $BASYX_SWAGGER > ./gen/source/basyx-aas.yaml | |
- name: generate go code | |
run: | | |
mkdir -p ./gen/go/ | |
go install github.com/deepmap/oapi-codegen/cmd/oapi-codegen@latest | |
oapi-codegen gen/source/basyx-aas.yaml > ./gen/go/basyx.go | |
- name: commit & push | |
run: | | |
git add -N . # 新規ファイルを含める | |
if ! git diff --exit-code --quiet | |
then | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
git add . | |
git commit -m "Update" | |
git push | |
fi |