Skip to content

Commit

Permalink
(feature): Add Go snippet generation (#3035)
Browse files Browse the repository at this point in the history
  • Loading branch information
amckinney authored Feb 22, 2024
1 parent a4e45c5 commit a0a9069
Show file tree
Hide file tree
Showing 1,292 changed files with 81,348 additions and 9,252 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/seed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
postman: ${{ steps.filter.outputs.postman }}
java: ${{ steps.filter.outputs.java }}
typescript: ${{ steps.filter.outputs.typescript }}
go: ${{ steps.filter.outputs.go }}
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
Expand All @@ -41,6 +42,7 @@ jobs:
postman: 'generators/postman/**'
java: 'generators/java/**'
typescript: 'generators/typescript/**'
go: 'generators/go/**'
ruby-model:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -368,3 +370,78 @@ jobs:
- name: Ensure no changes to git-tracked files
run: git --no-pager diff --exit-code

go-fiber:
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.go == 'true' || needs.changes.outputs.seed == 'true' }}
steps:
- name: Checkout repo
uses: actions/checkout@v4

- uses: actions/setup-node@v3
with:
node-version: 18
cache: "yarn"

- name: Yarn Install
run: yarn install

- name: Seed Test
env:
FORCE_COLOR: "2"
run: |
yarn seed:local test --workspace go-fiber --parallel 16
- name: Ensure no changes to git-tracked files
run: git --no-pager diff --exit-code

go-model:
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.go == 'true' || needs.changes.outputs.seed == 'true' }}
steps:
- name: Checkout repo
uses: actions/checkout@v4

- uses: actions/setup-node@v3
with:
node-version: 18
cache: "yarn"

- name: Yarn Install
run: yarn install

- name: Seed Test
env:
FORCE_COLOR: "2"
run: |
yarn seed:local test --workspace go-model --parallel 16
- name: Ensure no changes to git-tracked files
run: git --no-pager diff --exit-code

go-sdk:
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.go == 'true' || needs.changes.outputs.seed == 'true' }}
steps:
- name: Checkout repo
uses: actions/checkout@v4

- uses: actions/setup-node@v3
with:
node-version: 18
cache: "yarn"

- name: Yarn Install
run: yarn install

- name: Seed Test
env:
FORCE_COLOR: "2"
run: |
yarn seed:local test --workspace go-sdk --parallel 16
- name: Ensure no changes to git-tracked files
run: git --no-pager diff --exit-code
12 changes: 0 additions & 12 deletions generators/go/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,6 @@ install:
.PHONY: test
test: install
go test ./...
npm install -g @fern-api/[email protected]
seed test \
--fixture bytes \
--fixture enum \
--fixture file-upload \
--fixture idempotency-headers \
--fixture literal \
--fixture literal-headers \
--fixture plain-text \
--fixture query-parameters \
--fixture response-property \
--fixture streaming

.PHONY: fixtures
fixtures: install
Expand Down
2 changes: 1 addition & 1 deletion generators/go/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.16.0
0.17.0-rc0
1 change: 1 addition & 0 deletions generators/go/cmd/fern-go-fiber/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func run(config *cmd.Config, coordinator *coordinator.Client) ([]*generator.File
config.Organization,
config.Version,
config.IrFilepath,
config.SnippetFilepath,
config.ImportPath,
config.PackageName,
config.Module,
Expand Down
1 change: 1 addition & 0 deletions generators/go/cmd/fern-go-model/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func run(config *cmd.Config, coordinator *coordinator.Client) ([]*generator.File
config.Organization,
config.Version,
config.IrFilepath,
config.SnippetFilepath,
config.ImportPath,
config.PackageName,
config.Module,
Expand Down
1 change: 1 addition & 0 deletions generators/go/cmd/fern-go-sdk/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func run(config *cmd.Config, coordinator *coordinator.Client) ([]*generator.File
config.Organization,
config.Version,
config.IrFilepath,
config.SnippetFilepath,
config.ImportPath,
config.PackageName,
config.Module,
Expand Down
Loading

0 comments on commit a0a9069

Please sign in to comment.