Skip to content

Commit

Permalink
gh actions, coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
k-wojcik committed Jul 23, 2024
1 parent d2690e1 commit faadd3f
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Build after commit
name: Pull request build

on:
push:
branches: [master]
pull_request:
branches: [master]

Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/push-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Build after push to master

on:
push:
branches: [master]

jobs:
build-linux-x64:
runs-on: ubuntu-latest
env:
VCPKG_DISABLE_METRICS: 1
VCPKG_INSTALLED_DIR: ${{ github.workspace }}/vcpkg_installed
steps:
- uses: actions/checkout@v4
- name: vcpkg x64-linux
uses: lukka/run-vcpkg@v11
env:
VCPKG_DEFAULT_TRIPLET: x64-linux-dynamic
with:
doNotCache: false
runVcpkgInstall: true
- name: copy lib
run: mkdir -p libs/x64-linux/ && cp vcpkg_installed/x64-linux-dynamic/lib/libroaring.so libs/x64-linux/
- name: Upload lib to artifacts
uses: actions/upload-artifact@v4
with:
name: libs-linux-x64
path: |
libs/**/*.so
build-dotnet:
runs-on: ubuntu-latest
needs: [build-linux-x64]
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
steps:
- uses: actions/checkout@v4

- name: Download libs atrifacts
uses: actions/download-artifact@v4
with:
name: libs-linux-x64
path: libs

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore --configuration Release

- name: Test
run: dotnet test --no-build --configuration Release /p:CollectCoverage=true /p:CoverletOutputFormat=opencover

- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}

- uses: geekyeggo/delete-artifact@v5
with:
name: libs-*

2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ jobs:
path: libs

- name: Set the version env
run: echo VERSION=${GITHUB_REF#refs/tags/} >> $GITHUB_ENV
run: echo VERSION=${GITHUB_REF#refs/tags/v} >> $GITHUB_ENV

- name: Setup .NET
uses: actions/setup-dotnet@v4
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ vcpkg_installed/
*.VisualState.xml
TestResult.xml

# coverlet
coverage.opencover.xml

# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

A .Net wrapper for [CRoaring](https://github.com/RoaringBitmap/CRoaring) - a C implementation of [RoaringBitmap](https://github.com/RoaringBitmap/RoaringBitmap).

[![push-master workflow status](https://img.shields.io/github/actions/workflow/status/k-wojcik/Roaring.Net/push-master.yml)](https://github.com/k-wojcik/Roaring.Net/actions/workflows/push-master.yml)
[![GitHub Release](https://img.shields.io/github/v/release/k-wojcik/Roaring.Net?include_prereleases&sort=semver)](https://github.com/k-wojcik/Roaring.Net/releases)
[![NuGet Version](https://img.shields.io/nuget/vpre/Roaring.Net)](https://www.nuget.org/packages/Roaring.Net)
[![codecov](https://codecov.io/github/k-wojcik/Roaring.Net/graph/badge.svg?token=ITL13NZGAH)](https://codecov.io/github/k-wojcik/Roaring.Net)

## Usage
```cs
using (var rb1 = new RoaringBitmap())
Expand Down
8 changes: 8 additions & 0 deletions test/Roaring.Net.Test/Roaring.Net.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
<ProjectReference Include="../../src/Roaring.Net/Roaring.Net.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.msbuild" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
Expand Down

0 comments on commit faadd3f

Please sign in to comment.