3
3
4
4
name : dotnet build and test
5
5
6
+ env :
7
+ DOTNET_NOLOGO : 1
8
+ DOTNET_CLI_TELEMETRY_OPTOUT : 1
9
+
6
10
on :
7
11
push :
8
12
branches : [ "main" ]
11
15
12
16
jobs :
13
17
build :
14
- runs-on : ubuntu-latest
18
+ runs-on : ${{ matrix.os }}
15
19
strategy :
16
20
matrix :
17
- dotnet-version : ['8.x' ]
21
+ # os:
22
+ # - ubuntu-latest
23
+ # - macos-latest
24
+ # - macos-14
25
+ # rid: # [ "linux-x64", "linux-arm64", "osx-x64", "osx-arm64" ]
26
+ # - linux-x64
27
+ # - linux-arm64
28
+ # - osx-x64
29
+ # - osx-arm64
30
+ include :
31
+ - os : ubuntu-latest
32
+ rid : linux-x64
33
+ - os : macos-latest
34
+ rid : osx-x64
35
+ - os : macos-14
36
+ rid : osx-arm64
18
37
19
38
steps :
20
39
- uses : actions/checkout@v4
21
- - name : Setup .NET Core 6.x
40
+
41
+ - name : Cache libchdb.so
42
+ id : cache-libchdb
43
+ uses : actions/cache@v4
44
+ with :
45
+ path : libchdb.so
46
+ key : ${{ matrix.rid }}-libchdb
47
+
48
+ - name : Download chdb library
49
+ # if: steps.cache-libchdb.outputs.cache-hit != 'true'
50
+ run : ./update_libchdb.sh
51
+
52
+ - name : Setup .NET Core
22
53
uses : actions/setup-dotnet@v3
23
54
with :
24
55
dotnet-version : |
25
56
6.0.x
26
57
8.0.x
27
- # cache: true
58
+ cache : true
59
+
28
60
- name : Display dotnet version
29
61
run : dotnet --version
30
- env :
31
- DOTNET_NOLOGO : 1
32
- DOTNET_CLI_TELEMETRY_OPTOUT : 1
33
- # - name: Cache libchdb.so
34
- # id: cache-libchdb
35
- # uses: actions/cache@v4
36
- # with:
37
- # path: libchdb.so
38
- # key: ${{ runner.os }}-libchdb
39
- - name : Download chdb library
40
- # if: steps.cache-libchdb.outputs.cache-hit != 'true'
41
- run : ./update_libchdb.sh
42
- # - uses: actions/cache@v3
43
- # with:
44
- # path: ~/.nuget/packages
45
- # key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
46
- # restore-keys: |
47
- # ${{ runner.os }}-nuget-
48
62
49
63
- name : Restore
50
64
run : dotnet restore
65
+
51
66
- name : Build
52
67
run : dotnet build --no-restore --configuration Release
68
+
53
69
- name : Test
54
- run : dotnet test --configuration Release --no-build --logger trx --results-directory "TestResults-${{ matrix.dotnet-version }}"
70
+ run : dotnet test -c Release --logger trx --results-directory "TestResults-${{ matrix.rid }}"
71
+
55
72
- name : Upload dotnet test results
56
73
uses : actions/upload-artifact@v4
57
74
with :
58
- name : dotnet-results-${{ matrix.dotnet-version }}
59
- path : TestResults-${{ matrix.dotnet-version }}
75
+ name : dotnet-results-${{ matrix.rid }}
76
+ path : TestResults-${{ matrix.rid }}
60
77
# Use always() to always run this step to publish test results when there are test failures
61
78
if : ${{ always() }}
79
+
62
80
- name : Test chdb-tool
63
81
run : |
64
- dotnet tool install --global chdb-tool --version 0.0.1
82
+ dotnet tool install --add-sources ./nupkg -- global chdb-tool --version 0.0.1
65
83
chdb --help
66
84
chdb "select version()" PrettyCompact
67
85
- name : Pack
68
- run : dotnet pack -c Release --include-symbols
86
+ run : |
87
+ dotnet pack src/chdb/chdb.csproj -c Release --include-symbols -p:PackageID=chdb-${{ matrix.rid }} -r ${{ matrix.rid }}
88
+ dotnet pack src/chdb-tool/chdb-tool.csproj -c Release -p:PackageID=chdb-tool${{ matrix.rid }} -r ${{ matrix.rid }}
89
+
90
+ - name : List artifacts
91
+ run : ls -l nupkg/*.nupkg
0 commit comments