forked from bterlson/openai-in-typespec
-
Notifications
You must be signed in to change notification settings - Fork 14
57 lines (50 loc) · 1.52 KB
/
main.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
name: Build and Test
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize]
jobs:
test_swagger_editor_validator_service:
runs-on: ubuntu-latest
name: Swagger Editor Validator Service
# Service containers to run with `runner-job`
services:
# Label used to access the service container
swagger-editor:
# Docker Hub image
image: swaggerapi/swagger-editor
ports:
# Maps port 8080 on service container to the host 80
- 80:8080
steps:
- uses: actions/checkout@v2
- name: Validate OpenAPI definition
uses: char0n/swagger-editor-validate@v1
with:
swagger-editor-url: http://localhost/
definition-file: openapi.yaml
# Test, pack and publish the Open AI nuget package as a build artifact
build:
runs-on: ubuntu-latest
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.x
- name: Checkout code
uses: actions/checkout@v2
- name: Pack
run: dotnet pack
-c Release
-o "${{github.workspace}}/packages"
${{ github.ref == 'refs/heads/main' && '' || format('--version-suffix="alpha.{0}"', github.run_number) }}
working-directory: .dotnet
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: package
path: packages/*.nupkg
if: ${{ github.event_name != 'pull_request' }}