-
Notifications
You must be signed in to change notification settings - Fork 18
95 lines (91 loc) · 4 KB
/
dotnet.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
name: .NET
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
dotnet-format:
runs-on: windows-latest
steps:
- name: 🤘 checkout
uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0
- name: ⚙ dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
- name: Workaround
#https://github.com/dotnet/format/issues/1433#issuecomment-1055920818
run: dotnet tool install -g dotnet-format --version "6.*" --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json
- name: ✓ ensure format UA-CloudLibrary Server
working-directory: UACloudLibraryServer
run: dotnet-format --verify-no-changes -v:diag --exclude ~/.nuget
- name: ✓ ensure format UA-CloudLibrary .NET Client
working-directory: Opc.Ua.CloudLib.Client
run: dotnet-format --verify-no-changes -v:diag --exclude ~/.nuget
- name: ✓ ensure format UA-CloudLibrary SampleConsoleClient
working-directory: SampleConsoleClient
run: dotnet-format --verify-no-changes -v:diag --exclude ~/.nuget
build:
runs-on: ubuntu-latest
steps:
- name: Start PostgreSQL on Ubuntu
run: |
sudo systemctl start postgresql.service
pg_isready
- name: Create additional user
run: |
sudo -u postgres psql --command="CREATE USER testuser SUPERUSER PASSWORD 'password'" --command="\du"
- name: Create test database with proper collation
run: |
sudo -u postgres psql --command="create database cloudlib_test with LC_COLLATE = 'en_US.UTF8' LC_CTYPE = 'en_US.UTF8' TEMPLATE template0"
- name: List existing databases
run: |
sudo -u postgres psql -l --command="\du"
- name: 🤘 checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: ⚙ dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
- name: Restore dependencies UA-CloudLibrary
working-directory: UACloudLibraryServer
run: dotnet restore
- name: Restore dependencies UA-CloudLibrary .NET Client
run: dotnet restore
working-directory: Opc.Ua.CloudLib.Client
- name: Restore dependencies SampleConsoleClient
run: dotnet restore
working-directory: SampleConsoleClient
- name: Restore dependencies CloudLibClientTests
run: dotnet restore
working-directory: Tests/CloudLibClientTests
- name: Restore dependencies CloudLibSync
working-directory: CloudLibSync
run: dotnet restore
- name: Restore dependencies CloudLibSyncAzureFunction
working-directory: CloudLibSyncAzureFunction
run: dotnet restore
- name: Build
run: dotnet build UA-CloudLibrary.sln --configuration Release --no-restore
- name: Test
run: dotnet test UA-CloudLibrary.sln --no-build --configuration Release --verbosity normal -l:"console;verbosity=normal"
- name: List databases after test run
run: |
sudo -u postgres psql -l --command="\du"
- name: pack NuGet
run: dotnet pack Opc.Ua.CloudLib.Client/Opc.Ua.Cloud.Library.Client.csproj --configuration Release
- name: add github nuget-feed#
if: ${{ github.event_name != 'pull_request' }} # Will only push nuget, when not in pull_request
run: dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
- name: publish NuGet
if: ${{ github.event_name != 'pull_request' }} # Will only push nuget, when not in pull_request
run: dotnet nuget push "Opc.Ua.CloudLib.Client/bin/Release/*.nupkg" --source "github"
- name: publish NuGet Symbols
if: ${{ github.event_name != 'pull_request' }} # Will only push nuget, when not in pull_request
run: dotnet nuget push "Opc.Ua.CloudLib.Client/bin/Release/*.snupkg" --source "github"