-
Notifications
You must be signed in to change notification settings - Fork 5
142 lines (142 loc) · 4.41 KB
/
openapi_codegen.yml
File metadata and controls
142 lines (142 loc) · 4.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: openapi_codegen
on:
- pull_request
- workflow_dispatch
env:
SCHEMA_FILE: examples/openapi-codegen-test-api.yaml
jobs:
client_fetch:
name: client-fetch
runs-on: ubuntu-latest
env:
BUILD_DIR: examples/openapi-codegen/client-fetch
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install dependencies
run: npm install
- name: Build the project
run: npx lerna run build --skip-nx-cache --scope=@fresha/openapi-codegen-cli
- name: Prepare the build folder
run: |
mkdir -p "$BUILD_DIR"
cp -R examples/codegen/client_fetch/* "$BUILD_DIR"
cd "$BUILD_DIR"
npm install
cd ../../..
- name: Generate code
run: |
npx fresha-openapi-codegen client-fetch \
--input "$SCHEMA_FILE" \
--output "$BUILD_DIR" \
--json-api \
--api-naming kebab \
--client-naming camel \
--verbose
- name: Transpile generated code
run: |
cd "$BUILD_DIR"
npm run build -- --module commonjs --outDir ./build/cjs
npm run build -- --module esnext --outDir ./build/esm
docs:
name: docs
runs-on: ubuntu-latest
env:
BUILD_DIR: examples/openapi-codegen/docs
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install dependencies
run: npm install
- name: Build the project
run: npx lerna run build --skip-nx-cache --scope=@fresha/openapi-codegen-cli
- name: Prepare the build folder
run: mkdir -p "$BUILD_DIR"
- name: Generate the documentation
run: |
npx fresha-openapi-codegen docs-json-api \
--input "$SCHEMA_FILE" \
--output "$BUILD_DIR" \
--json-api \
--verbose
server_elixir:
name: server-elixir
runs-on: ubuntu-latest
env:
BUILD_DIR: examples/openapi-codegen/server-elixir
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install dependencies
run: npm install
- name: Build the project
run: npx lerna run build --skip-nx-cache --scope=@fresha/openapi-codegen-cli
- name: Prepare the build folder
run: |
mkdir -p "$BUILD_DIR"
- name: Generate the code
run: |
npx fresha-openapi-codegen server-elixir \
--input "$SCHEMA_FILE" \
--output "$BUILD_DIR" \
--json-api \
--phoenix-app ElixirApiWeb \
--test-factory-module ElixirApiTestFactory \
--verbose
# server_nestjs:
# name: server-nestjs
# runs-on: ubuntu-latest
# env:
# BUILD_DIR: examples/openapi-codegen/server-nestjs
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# node-version: 18.x
# - name: Install dependencies
# run: npm install
# - name: Build the project
# run: npx lerna run build --skip-nx-cache --scope=@fresha/openapi-codegen-cli
# - name: Prepare the build folder
# run: |
# mkdir -p "$BUILD_DIR"
# cp -R examples/codegen/nestjs_multi_api/* "$BUILD_DIR"
# - name: Generate application code
# run: |
# npx fresha-openapi-codegen server-nestjs \
# --input "$SCHEMA_FILE" \
# --output "$BUILD_DIR" \
# --json-api \
# --nest-app web \
# --verbose
server_mock:
name: server-mock
runs-on: ubuntu-latest
env:
BUILD_DIR: examples/openapi-codegen/server-mock
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install dependencies
run: npm install
- name: Build the project
run: npx lerna run build --skip-nx-cache --scope=@fresha/openapi-codegen-cli
- name: Prepare the build folder
run: |
mkdir -p "$BUILD_DIR"
cp -R examples/codegen/mock_api/* "$BUILD_DIR"
- name: Generate application code
run: |
npx fresha-openapi-codegen server-mock \
--input "$SCHEMA_FILE" \
--output "$BUILD_DIR" \
--json-api \
--verbose