-
Notifications
You must be signed in to change notification settings - Fork 4
102 lines (83 loc) · 2.98 KB
/
pre-integration.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
name: "Pre-Integration"
on:
pull_request:
types:
- opened
- synchronize
- reopened
jobs:
dotnet-build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: 🛒 Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: ⚙️ Setup dotnet 8.0.x
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: 📐 Ensure nuget.org added as package source on Windows
if: matrix.os == 'windows-latest'
run: dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org --configfile $env:APPDATA\NuGet\NuGet.Config
continue-on-error: true
- name: 🔁 Restore packages
run: dotnet restore
- name: 🛠️ Building library in release mode
run: dotnet build -c Release --no-restore
dotnet-test:
runs-on: ubuntu-latest
needs:
- dotnet-build
steps:
- name: 🛒 Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: ⚙️ Setup dotnet 8.0.x
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: 🔁 Restore packages
run: dotnet restore
- name: 🛠️ Build
run: dotnet build -c Release --no-restore /p:UseSourceLink=true
- name: 🧪 Run unit tests
run: dotnet test -c Release --no-build --filter "Category!=Integration"
smoke-tests:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
needs:
- dotnet-test
steps:
- name: 🛒 Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: ⚙️ Setup dotnet 8.0.x
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: 📐 Ensure nuget.org added as package source on Windows
if: matrix.os == 'windows-latest'
run: dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org --configfile $env:APPDATA\NuGet\NuGet.Config
continue-on-error: true
- name: 🔁 Restore packages
run: dotnet restore
- name: 🛠️ Build with dotnet
run: dotnet build Atc.Rest.Api.Generator.sln
- name: ⬇️🌎 Download Swagger Petstore v3 spec
run: curl -O https://petstore3.swagger.io/api/v3/openapi.yaml
- name: ⚙️ Generate Code
run: dotnet run -- generate server all -p "Swagger Petstore" -s ../../openapi.yaml --outputSlnPath ../../petstore3/ --outputSrcPath ../../petstore3/src --outputTestPath ../../petstore3/test --optionsPath ../../ApiGeneratorOptions.json --disableCodingRules --verbose
working-directory: src/Atc.Rest.ApiGenerator.CLI
- name: 🛠️ Build Generated Code
run: dotnet build
working-directory: petstore3