gh actions fix #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will build a .NET project | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | ||
name: dotnet build and test | ||
env: | ||
DOTNET_NOLOGO: 1 | ||
DOTNET_CLI_TELEMETRY_OPTOUT: 1 | ||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
# os: | ||
# - ubuntu-latest | ||
# - macos-latest | ||
# - macos-14 | ||
# rid: # [ "linux-x64", "linux-arm64", "osx-x64", "osx-arm64" ] | ||
# - linux-x64 | ||
# - linux-arm64 | ||
# - osx-x64 | ||
# - osx-arm64 | ||
include: | ||
- os: ubuntu-latest | ||
rid: linux-x64 | ||
- os: macos-latest | ||
rid: osx-x64 | ||
- os: macos-14 | ||
rid: osx-arm64 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Cache libchdb.so | ||
id: cache-libchdb | ||
uses: actions/cache@v4 | ||
with: | ||
path: libchdb.so | ||
key: ${{ matrix.rid }}-libchdb | ||
- name: Download chdb library | ||
if: steps.cache-libchdb.outputs.cache-hit != 'true' | ||
run: ./update_libchdb.sh | ||
- name: Setup .NET Core | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: | | ||
6.0.x | ||
8.0.x | ||
cache: true | ||
- name: Display dotnet version | ||
run: dotnet --version | ||
- name: Restore | ||
run: dotnet restore | ||
- name: Build | ||
run: dotnet build --no-restore --configuration Release | ||
- name: Test | ||
run: dotnet test -c Release --logger trx --results-directory "TestResults-${{ matrix.rid }}" | ||
- name: Upload dotnet test results | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: dotnet-results-${{ matrix.rid }} | ||
path: TestResults-${{ matrix.rid }} | ||
# Use always() to always run this step to publish test results when there are test failures | ||
if: ${{ always() }} | ||
- name: Test chdb-tool | ||
run: | | ||
dotnet tool install --add-sources ./nupkg --global chdb-tool --version 0.0.1 | ||
chdb --help | ||
chdb "select version()" PrettyCompact | ||
- name: Pack | ||
run: | | ||
dotnet pack src/chdb/chdb.csproj -c Release --include-symbols -p:PackageID=chdb-${{ matrix.rid }} -r ${{ matrix.rid }} | ||
dotnet pack src/chdb-tool/chdb-tool.csproj -c Release -p:PackageID=chdb-tool${{ matrix.rid }} -r ${{ matrix.rid }} | ||
- name: List artifacts | ||
run: ls -l nupkg/*.nupkg |