33
44name : dotnet build and test
55
6+ env :
7+ DOTNET_NOLOGO : 1
8+ DOTNET_CLI_TELEMETRY_OPTOUT : 1
9+
610on :
711 push :
812 branches : [ "main" ]
1115
1216jobs :
1317 build :
14- runs-on : ubuntu-latest
18+ runs-on : ${{ matrix.os }}
1519 strategy :
1620 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
1837
1938 steps :
2039 - 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
2253 uses : actions/setup-dotnet@v3
2354 with :
2455 dotnet-version : |
2556 6.0.x
2657 8.0.x
27- # cache: true
58+ cache : true
59+
2860 - name : Display dotnet version
2961 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-
4862
4963 - name : Restore
5064 run : dotnet restore
65+
5166 - name : Build
5267 run : dotnet build --no-restore --configuration Release
68+
5369 - 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+
5572 - name : Upload dotnet test results
5673 uses : actions/upload-artifact@v4
5774 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 }}
6077 # Use always() to always run this step to publish test results when there are test failures
6178 if : ${{ always() }}
79+
6280 - name : Test chdb-tool
6381 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
6583 chdb --help
6684 chdb "select version()" PrettyCompact
6785 - 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