Skip to content

Commit de7ef5d

Browse files
committed
chore(test): update workflow to test with windows
1 parent 02b42e8 commit de7ef5d

2 files changed

Lines changed: 127 additions & 1 deletion

File tree

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
name: Build
2+
on:
3+
push:
4+
tags-ignore:
5+
- '*.*'
6+
branches-ignore:
7+
- master
8+
- renovate/**
9+
pull_request:
10+
types: [ assigned, opened, synchronize, reopened ]
11+
jobs:
12+
build:
13+
name: Build
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
node-version: [ 22.x ]
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v7
22+
23+
- name: Use Node.js ${{matrix.node-version }}
24+
uses: actions/setup-node@v6
25+
with:
26+
node-version: ${{matrix.node-version }}
27+
28+
- name: Install
29+
run: yarn --frozen-lockfile
30+
31+
- name: Lint
32+
run: yarn run lint
33+
34+
- name: Unit Test
35+
run: yarn run test
36+
37+
- name: Build
38+
run: yarn run build
39+
40+
- name: Build Package
41+
run: |
42+
cd dist/apps/generator-cli
43+
yarn pack -f ../package.tgz
44+
45+
- uses: actions/upload-artifact@v7
46+
with:
47+
name: package.tgz
48+
path: dist/apps/package.tgz
49+
50+
e2e:
51+
name: "E2E local: (${{ matrix.os }})"
52+
needs: build
53+
runs-on: ${{ matrix.os }}
54+
strategy:
55+
matrix:
56+
os: [windows-latest]
57+
node-version: [ 22.x ]
58+
59+
steps:
60+
- name: Checkout
61+
uses: actions/checkout@v7
62+
63+
- name: Use Node.js ${{matrix.node-version }}
64+
uses: actions/setup-node@v6
65+
with:
66+
node-version: ${{matrix.node-version }}
67+
68+
- uses: actions/download-artifact@v8
69+
with:
70+
name: package.tgz
71+
72+
- name: Test
73+
run: |
74+
cd examples
75+
yarn global add json
76+
yarn cache clean && yarn add $GITHUB_WORKSPACE/package.tgz
77+
npm run oa version
78+
npm run oa completion
79+
npm run oa help
80+
npm run oa help generate
81+
npm run oa version-manager help
82+
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
83+
(npm run oa version-manager set 3.0.0 && npm run oa version | grep -q '3.0.0') || exit 1
84+
(npm run oa version-manager set 6.0 && npm run oa version | grep -q '6.0.1') || exit 1
85+
(npm run oa version-manager set 4.3.1 && npm run oa version | grep -q '4.3.1') || exit 1
86+
(npm run oa version-manager set 4.3.1 && npm run oa version | grep -q '4.3.1') || exit 1
87+
(export OPENAPI_GENERATOR_CLI_SEARCH_URL=DEFAULT && npm run oa version-manager set 7.2.0 && npm run oa version | grep -q '7.2.0') || exit 1
88+
json -I -f openapitools.json -e 'this["generator-cli"]["storageDir"]="./my/storage/"'
89+
(npm run oa version-manager set 4.3.0 && npm run oa version | grep -q '4.3.0') || exit 1
90+
test -f ./my/storage/4.3.0.jar || exit 1
91+
json -I -f openapitools.json -e 'this["generator-cli"]["storageDir"]="~/my/storage/"'
92+
(npm run oa version-manager set 4.3.1 && npm run oa version | grep -q '4.3.1') || exit 1
93+
test -f ~/my/storage/4.3.1.jar || exit 1
94+
npm run oa:generate && mkdir ./foo && cd ./foo && npm run oa:generate
95+
#- name: Test with HTTP proxy
96+
# run: |
97+
# cd ./examples
98+
# yarn global add json && export PATH="$(yarn global bin):$PATH"
99+
# yarn cache clean && yarn add $GITHUB_WORKSPACE/package.tgz
100+
# export HTTP_PROXY=http://proxy_ip:proxy_port
101+
# 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
102+
# rel#ease:
103+
# if: github.event.pull_request.merged == 'true'
104+
# name: Release (Dry)
105+
# # needs: e2e # DONT FORGET TO ENABLE ME !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
106+
# runs-on: ubuntu-18.04
107+
# steps:
108+
#
109+
# - name: Checkout
110+
# uses: actions/checkout@v2
111+
# with:
112+
# fetch-depth: 0
113+
#
114+
# - name: Use Node.js ${{matrix.node-version }}
115+
# uses: actions/setup-node@v1
116+
# with:
117+
# node-version: ${{matrix.node-version }}
118+
#
119+
# - name: Install
120+
# run: yarn --frozen-lockfile
121+
#
122+
# - name: Release
123+
# env:
124+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
125+
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
126+
# run: npx semantic-release -d

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
runs-on: ${{ matrix.os }}
5454
strategy:
5555
matrix:
56-
os: [ubuntu-latest, macos-latest, windows-latest]
56+
os: [ubuntu-latest, macos-latest]
5757
node-version: [ 22.x ]
5858

5959
steps:

0 commit comments

Comments
 (0)