-
-
Notifications
You must be signed in to change notification settings - Fork 71
129 lines (107 loc) · 4.09 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
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: "Build"
on:
workflow_dispatch:
push:
paths-ignore:
- '**.md'
- '**/NuGet.yml'
pull_request:
paths-ignore:
- '**.md'
schedule:
- cron: "15 */12 * * *"
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-14]
arch: ['amd64']
fail-fast: false
name: Build library (${{ matrix.os }})
runs-on: ${{ matrix.os }}
steps:
- name: Set Build Branch
if: github.event_name == 'schedule'
run: |
echo "BuildBranch=nightly-builds" >> "$GITHUB_ENV"
echo "BuildBranch=nightly-builds" >> $env:GITHUB_ENV
- name: Set Env
if: startsWith(github.ref_name, 'nightly') || startsWith(env.BuildBranch, 'nightly')
run: |
echo "DuckDbArtifactRoot=https://carlopi.github.io/duckdb-latest" >> "$GITHUB_ENV"
echo "SkipArm=True" >> "$GITHUB_ENV"
echo "DuckDbArtifactRoot=https://carlopi.github.io/duckdb-latest" >> $env:GITHUB_ENV
echo "SkipArm=True" >> $env:GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ env.BuildBranch }}
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Build
run: dotnet build --configuration Release /p:BuildType=Full
- name: Pack
if: matrix.os == 'ubuntu-latest' && github.event_name != 'pull_request'
run: |
dotnet pack DuckDB.NET.Bindings/Bindings.csproj --configuration Release
dotnet pack DuckDB.NET.Data/Data.csproj --configuration Release
dotnet pack DuckDB.NET.Bindings/Bindings.csproj --configuration Release /p:BuildType=Full
dotnet pack DuckDB.NET.Data/Data.csproj --configuration Release /p:BuildType=Full
- name: Run tests
env:
CoverletOutputFormat: lcov
run: dotnet test --configuration Release --verbosity normal --logger GitHubActions /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:BuildType=Full /p:DoesNotReturnAttribute="DoesNotReturnAttribute"
- name: Upload coverage reports to Coveralls Parallel
uses: coverallsapp/github-action@v2
if: github.event_name != 'schedule'
with:
github-token: ${{ secrets.github_token }}
flag-name: run-${{ matrix.os }}
path-to-lcov: DuckDB.NET.Test/coverage.net8.0.info
parallel: true
format: lcov
- name: Upload coverage reports to Codecov
if: matrix.os == 'ubuntu-latest' && github.event_name != 'schedule'
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: Giorgi/DuckDB.NET
- name: Upload Artifacts
if: matrix.os == 'ubuntu-latest' && github.event_name != 'pull_request' && github.actor == 'Giorgi'
uses: actions/upload-artifact@v4
with:
name: nugetPackages-${{github.ref_name}}
path: ./**/bin/Release/*.nupkg
publish:
needs: build
name: Publish Packages
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/develop' && github.event_name != 'pull_request' && github.event_name != 'schedule'
steps:
- name: Download nuget package artifact
uses: actions/download-artifact@v4
with:
name: nugetPackages-${{github.ref_name}}
- name: Display structure of downloaded files
run: ls -R
- name: Prep packages
run: dotnet nuget add source --username Giorgi --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/Giorgi/index.json"
- name: Push package to GitHub packages
run: dotnet nuget push "**/*.nupkg" --api-key ${{ secrets.GITHUB_TOKEN }} --source "github"
Finish-Coveralls-Collection:
needs: build
name: Finish Coveralls Collection
runs-on: ubuntu-latest
if: github.event_name != 'schedule'
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true