forked from adnbrownie/openapi-generator-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
119 lines (105 loc) · 3.65 KB
/
build.yml
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
name: Build
on:
push:
tags-ignore:
- '*.*'
branches-ignore:
- master
- renovate/**
pull_request:
types: [ assigned, opened, synchronize, reopened ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 18.x ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js ${{matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{matrix.node-version }}
- name: Install
run: yarn --frozen-lockfile
- name: Lint
run: yarn run lint
- name: Unit Test
run: yarn run test
- name: Build
run: yarn run build
- name: Build Package
run: |
cd dist/apps/generator-cli
yarn pack -f ../package.tgz
- uses: actions/upload-artifact@v3
with:
name: package.tgz
path: dist/apps/package.tgz
e2e:
name: "E2E local: (${{ matrix.os }})"
needs: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
node-version: [ 18.x ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js ${{matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{matrix.node-version }}
- uses: actions/download-artifact@v3
with:
name: package.tgz
- name: Test
run: |
cd ./examples
yarn global add json && export PATH="$(yarn global bin):$PATH"
yarn cache clean && yarn add $GITHUB_WORKSPACE/package.tgz
npm run oa version
npm run oa completion
npm run oa help
npm run oa help generate
npm run oa version-manager help
npm run oa generate -- -g ruby -i https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -o $GITHUB_WORKSPACE/tmp/ruby-client
(npm run oa version-manager set 3.0.0 && npm run oa version | grep -q '3.0.0') || exit 1
(npm run oa version-manager set 4.0 && npm run oa version | grep -q '4.0.3') || exit 1
(npm run oa version-manager set 4.3.1 && npm run oa version | grep -q '4.3.1') || exit 1
(npm run oa version-manager set 4.3.1 && npm run oa version | grep -q '4.3.1') || exit 1
json -I -f openapitools.json -e 'this["generator-cli"]["storageDir"]="./my/storage/"'
(npm run oa version-manager set 4.3.0 && npm run oa version | grep -q '4.3.0') || exit 1
test -f ./my/storage/4.3.0.jar || exit 1
json -I -f openapitools.json -e 'this["generator-cli"]["storageDir"]="~/my/storage/"'
(npm run oa version-manager set 4.3.1 && npm run oa version | grep -q '4.3.1') || exit 1
test -f ~/my/storage/4.3.1.jar || exit 1
npm run oa:generate && mkdir ./foo && cd ./foo && npm run oa:generate
# release:
# if: github.event.pull_request.merged == 'true'
# name: Release (Dry)
# # needs: e2e # DONT FORGET TO ENABLE ME !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# runs-on: ubuntu-18.04
# steps:
#
# - name: Checkout
# uses: actions/checkout@v2
# with:
# fetch-depth: 0
#
# - name: Use Node.js ${{matrix.node-version }}
# uses: actions/setup-node@v1
# with:
# node-version: ${{matrix.node-version }}
#
# - name: Install
# run: yarn --frozen-lockfile
#
# - name: Release
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# run: npx semantic-release -d