Skip to content

Build

Build #1361

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
- 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