Skip to content

Commit 45e4fa1

Browse files
authored
Add workflow for PowerShell clients (#21979)
* add workflow for powershell client * update * fix container * import, test * combine * use localhost * update tests * remove powershell tests from appveyor.yml
1 parent 46de9c8 commit 45e4fa1

File tree

14 files changed

+65
-22
lines changed

14 files changed

+65
-22
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Samples PowerShell
2+
3+
on:
4+
push:
5+
paths:
6+
- samples/client/petstore/powershell/**
7+
pull_request:
8+
paths:
9+
- samples/client/petstore/powershell/**
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
name: Test Powershell Clients
14+
strategy:
15+
matrix:
16+
sample:
17+
- samples/client/petstore/powershell/
18+
services:
19+
petstore-api:
20+
image: swaggerapi/petstore
21+
ports:
22+
- 80:8080
23+
env:
24+
SWAGGER_HOST: http://petstore.swagger.io
25+
SWAGGER_BASE_PATH: /v2
26+
steps:
27+
- uses: actions/checkout@v5
28+
- name: Build the client
29+
working-directory: ${{ matrix.sample }}
30+
shell: pwsh
31+
run: |
32+
./Build.ps1
33+
- name: Test
34+
working-directory: ${{ matrix.sample }}
35+
shell: pwsh
36+
run: |
37+
Import-Module -Name './src/PSPetstore'
38+
Invoke-Pester -PassThru
39+
40+

appveyor.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ install:
1313
- cmd: docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore
1414
- ps: Start-Sleep -s 120
1515
- ps: $PSVersionTable.PSVersion
16-
- ps: Install-Module -Name Pester -Force -Scope CurrentUser -SkipPublisherCheck
1716
build_script:
1817
- dotnet --info
1918
# build C# aspnetcore 5.0 server
@@ -108,11 +107,6 @@ test_script:
108107
# - .\bin\windows\run-all-petstore.cmd
109108
# generate all petstore clients (openapi3)
110109
# - .\bin\openapi3\windows\run-all-petstore.cmd
111-
112-
# test ps petstore
113-
- ps: |
114-
cd samples\client\petstore\powershell\
115-
.\CIRunTest.ps1
116110
cache:
117111
- C:\maven\
118112
- C:\gradle\

modules/openapi-generator/src/test/resources/3_0/powershell/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ paths:
3131
$ref: '#/components/schemas/Foo'
3232
/pet:
3333
servers:
34+
- url: 'http://localhost/v2'
3435
- url: 'http://petstore.swagger.io/v2'
3536
- url: 'http://path-server-test.petstore.local/v2'
3637
post:
@@ -1170,6 +1171,7 @@ paths:
11701171
schema:
11711172
$ref: '#/components/schemas/ArrayOfEnums'
11721173
servers:
1174+
- url: 'http://localhost/v2'
11731175
- url: 'http://{server}.swagger.io:{port}/v2'
11741176
description: petstore server
11751177
variables:

samples/client/petstore/powershell/.openapi-generator-ignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@
2121
#docs/*.md
2222
# Then explicitly reverse the ignore rule for a single file:
2323
#!docs/README.md
24+
#
25+
#
26+
#

samples/client/petstore/powershell/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ For troubleshooting, please run `$DebugPreference = 'Continue'` to turn on debug
5252

5353
## Documentation for API Endpoints
5454

55-
All URIs are relative to *http://petstore.swagger.io:80/v2*
55+
All URIs are relative to *http://localhost/v2*
5656

5757
Class | Method | HTTP request | Description
5858
------------ | ------------- | ------------- | -------------

samples/client/petstore/powershell/docs/PSAnotherFakeApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# PSPetstore.PSPetstore\Api.PSAnotherFakeApi
22

3-
All URIs are relative to *http://petstore.swagger.io:80/v2*
3+
All URIs are relative to *http://localhost/v2*
44

55
Method | HTTP request | Description
66
------------- | ------------- | -------------

samples/client/petstore/powershell/docs/PSDefaultApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# PSPetstore.PSPetstore\Api.PSDefaultApi
22

3-
All URIs are relative to *http://petstore.swagger.io:80/v2*
3+
All URIs are relative to *http://localhost/v2*
44

55
Method | HTTP request | Description
66
------------- | ------------- | -------------

samples/client/petstore/powershell/docs/PSFakeApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# PSPetstore.PSPetstore\Api.PSFakeApi
22

3-
All URIs are relative to *http://petstore.swagger.io:80/v2*
3+
All URIs are relative to *http://localhost/v2*
44

55
Method | HTTP request | Description
66
------------- | ------------- | -------------

samples/client/petstore/powershell/docs/PSFakeClassnameTags123Api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# PSPetstore.PSPetstore\Api.PSFakeClassnameTags123Api
22

3-
All URIs are relative to *http://petstore.swagger.io:80/v2*
3+
All URIs are relative to *http://localhost/v2*
44

55
Method | HTTP request | Description
66
------------- | ------------- | -------------

samples/client/petstore/powershell/docs/PSPetApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# PSPetstore.PSPetstore\Api.PSPetApi
22

3-
All URIs are relative to *http://petstore.swagger.io:80/v2*
3+
All URIs are relative to *http://localhost/v2*
44

55
Method | HTTP request | Description
66
------------- | ------------- | -------------

0 commit comments

Comments
 (0)