This repository was archived by the owner on Dec 3, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
72 lines (64 loc) · 2.61 KB
/
ci.yml
File metadata and controls
72 lines (64 loc) · 2.61 KB
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
name: CI
on: [push, pull_request]
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
IGNORE_NORMALISATION_GIT_HEAD_MOVE: 1
GITHUBACTIONS: "True"
jobs:
build:
name: ${{ matrix.platform.name }} ${{ matrix.dotnet.name }}
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform:
- { name: Windows VS2022, os: windows-2022 }
- { name: Linux, os: ubuntu-20.04 }
- { name: MacOS, os: macos-12 }
dotnet:
- { name: .NET 6, version: '6.0.x' }
- { name: .NET 7, version: '7.0.x' }
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Setup .NET ${{ matrix.dotnet.version }} SDK
id: setup-dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet.version }}
- name: Enforce SDK Version
run: dotnet new globaljson --sdk-version ${{ steps.setup-dotnet.outputs.dotnet-version }} --force
- name: Verify SDK Installation
run: dotnet --info
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: '5.x'
- name: Determine Version
uses: gittools/actions/gitversion/execute@v0
with:
useConfigFile: true
updateAssemblyInfo: true
additionalArguments: '/l console'
- name: Install Dependencies
run: dotnet restore source/Jobbr.Storage.MsSql.sln
- name: Build
run: dotnet build --configuration Release --no-restore source/Jobbr.Storage.MsSql.sln
- name: Install Docker on MacOS
if: runner.os == 'macOS'
run: |
brew install docker
colima start
- name: Install SQL Server on Linux or MacOS
if: runner.os != 'Windows'
run: docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=1StrongPwd!!" -p 1433:1433 -d mcr.microsoft.com/mssql/server:2019-latest
- name: Install SQL Server on Windows
if: runner.os == 'Windows'
run: choco install sql-server-2019 -y --params="'/Q /SUPPRESSPRIVACYSTATEMENTNOTICE /IACCEPTSQLSERVERLICENSETERMS /ACTION=Install /SkipRules=RebootRequiredCheck /FEATURES=SQLENGINE /SECURITYMODE=SQL /TCPENABLED=1 /SAPWD=1StrongPwd!!'"
- name: Test
if: runner.os != 'macOS' # Can't get the tests to fully connect to the SQL Server at the moment
run: dotnet test --no-restore --verbosity normal source/Jobbr.Storage.MsSql.sln
- name: NuGet Pack
run: nuget pack source/Jobbr.Storage.MsSql.nuspec -version "${{ env.GitVersion_SemVer }}" -prop "target=Release"