From ed456d88768bfb0d3e94154c19f4c918a6895700 Mon Sep 17 00:00:00 2001 From: Hassan Ahmed Date: Fri, 20 Oct 2023 13:43:16 +0200 Subject: [PATCH] readd goimport installation --- .github/workflows/lint.yml | 38 +++++++++++++++++++------------------- Makefile | 2 ++ 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 254ebf8c..adecb7e2 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -23,25 +23,25 @@ jobs: - run: npx swagger-cli bundle -t json -w 300 main.yaml > doc/compiled_new.json - run: diff doc/compiled.json doc/compiled_new.json - # compile-go: - # runs-on: ubuntu-latest - # steps: - # - name: Checkout 🛎️ - # uses: actions/checkout@v3 - # with: - # persist-credentials: false - # - name: Set up Go - # uses: actions/setup-go@v2 - # with: - # go-version: 1.19.6 - # - name: Build - # env: - # API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # run: | - # npm install - # npm run generate.go - # cd clients/go && go build + compile-go: + runs-on: ubuntu-latest + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v3 + with: + persist-credentials: false + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.19.6 + - name: Build + env: + API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + npm install + npm run generate.go + cd clients/go && go build # compile-cli: # runs-on: ubuntu-latest diff --git a/Makefile b/Makefile index f7459b7c..13ab16d6 100644 --- a/Makefile +++ b/Makefile @@ -33,6 +33,8 @@ ruby: openapi-generator-cli generate -i tmp/compiled.yaml -g ruby -o clients/ruby -c ./openapi-generator/ruby_lang.yaml go: openapi-generator-cli generate -i tmp/compiled.yaml -g go -o clients/go -c ./openapi-generator/go_lang.yaml + go install golang.org/x/tools/cmd/goimports@latest + goimports -w clients/go cd clients/go && go mod tidy typescript: openapi-generator-cli generate -i tmp/compiled.yaml -g typescript-fetch -o clients/typescript -c ./openapi-generator/typescript_lang.yaml