Skip to content

Correct three statements in the reader design notes and add measurements #2705

Correct three statements in the reader design notes and add measurements

Correct three statements in the reader design notes and add measurements #2705

Workflow file for this run

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
# Nightly native libraries: artifacts.duckdb.org/<branch>/, where 'latest' is DuckDB's main branch.
# Tracks the v2.0 release branch until DuckDB 2.0 ships; switch back to 'latest' after that.
- name: Set Env
if: startsWith(github.ref_name, 'nightly') || startsWith(env.BuildBranch, 'nightly')
run: |
echo "DuckDbArtifactRoot=https://artifacts.duckdb.org/v2.0-cyanoptera" >> "$GITHUB_ENV"
echo "NightlyBuild=true" >> "$GITHUB_ENV"
echo "DuckDbArtifactRoot=https://artifacts.duckdb.org/v2.0-cyanoptera" >> $env:GITHUB_ENV
echo "NightlyBuild=true" >> $env:GITHUB_ENV
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ env.BuildBranch }}
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v5
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: Get DuckDB version
shell: pwsh
run: |
$rid = @{ Linux = 'linux-x64'; Windows = 'win-x64'; macOS = 'osx' }['${{ runner.os }}']
$library = Get-ChildItem "DuckDB.NET.Bindings/obj/runtimes/$rid/native/*" -Include *.so, *.dll, *.dylib | Select-Object -First 1
Add-Type -TypeDefinition @"
using System;
using System.Runtime.InteropServices;
public static class DuckDBLibrary
{
[DllImport(@"$($library.FullName)")]
private static extern IntPtr duckdb_library_version();
public static string Version => Marshal.PtrToStringUTF8(duckdb_library_version());
}
"@
"DuckDBVersion=$([DuckDBLibrary]::Version)" >> $env:GITHUB_ENV
- name: Run tests (DuckDB ${{ env.DuckDBVersion }})
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/codecov-action@v6
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@v7
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@v8
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: Get package version
run: |
package=$(find . -name 'DuckDB.NET.Data.[0-9]*.nupkg' | head -n 1)
version=$(basename "$package" .nupkg)
echo "PackageVersion=${version#DuckDB.NET.Data.}" >> "$GITHUB_ENV"
- name: Push package to GitHub packages (${{ env.PackageVersion }})
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