-
Notifications
You must be signed in to change notification settings - Fork 6
67 lines (48 loc) · 2.2 KB
/
ci.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
name: CI
on: [ push, pull_request ]
env:
FACIL_FORCE_REGENERATE: 1
FACIL_FAIL_ON_CHANGED_OUTPUT: 1
connectionString: Data Source=localhost;Database=FacilTest;User ID=sa;Password=CXTxgxnkzcTcLMCwKjqi4XbKgwFtw;TrustServerCertificate=True
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
- name: Restore tools
run: dotnet tool restore
- name: Check code format
run: dotnet fantomas --check --recurse .
- name: Install SQL Server
run: |
docker run -d -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=CXTxgxnkzcTcLMCwKjqi4XbKgwFtw' -e 'MSSQL_COLLATION=SQL_Latin1_General_CP1_CI_AS' --name sql -p 1433:1433 samuelmarks/mssql-server-fts-sqlpackage-linux
sleep 10s
docker ps -a
docker logs -t sql
- name: Build DB
run: dotnet build src/TestDb/TestDb.sqlproj -c Release
- name: Publish DB
run: dotnet sqlpackage /Action:Publish /SourceFile:"src/TestDb/bin/Release/TestDb.dacpac" /TargetConnectionString:"$connectionString"
- name: Restore generator
run: dotnet restore src/Facil.Generator --locked-mode
- name: Build generator
run: dotnet build src/Facil.Generator -c Release --no-restore
- name: Restore package project
run: dotnet restore src/Facil.Package --locked-mode
- name: Build package project
run: dotnet build src/Facil.Package -c Release --no-restore
# Pack in a separate step (fails for some reason with "empty lib/" error if using <GeneratePackageOnBuild>)
- name: Pack
run: dotnet pack src/Facil.Package -c Release
# Build tests, which due to nuget.config should restore the locally built package
- name: Build tests
run: dotnet build src/DbTests -c Release
- name: Test
run: dotnet src/DbTests/bin/Release/net7.0/DbTests.dll --fail-on-focused-tests
- name: Push
if: startsWith(github.ref, 'refs/tags/v/')
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: dotnet nuget push "**/Facil*.nupkg" -s "https://api.nuget.org/v3/index.json" -k "$NUGET_API_KEY" --skip-duplicate