-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add gh-actions stubs * Update CI * Update solution * Add benchmark stub (fixes build) * Update CI * Update release * Fix using the wrong context for run_id https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
- Loading branch information
Showing
4 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: CI build-test-pack | ||
on: [push] | ||
jobs: | ||
build: | ||
name: Build and test (${{ matrix.os }}) | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest,windows-latest,macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup .NET SDK - 6.0.x | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '6.0.x' | ||
- name: Setup .NET SDK - 5.0.x | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '5.0.x' | ||
- name: Setup .NET SDK - 3.1.x | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '3.1.x' | ||
- name: Install dependencies | ||
run: dotnet restore | ||
- name: Build | ||
run: dotnet build --no-restore --configuration Release | ||
- name: Test | ||
run: dotnet test --no-restore --no-build --configuration Release --logger trx --results-directory "TestResults" | ||
- name: Upload test results | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: TestResults | ||
path: TestResults | ||
# Use always() to always run this step to publish test results when there are test failures | ||
if: ${{ always() }} | ||
- name: Pack | ||
run: dotnet pack --no-restore --no-build --configuration Release --version-suffix CI-${{ github.run_id }} --output pkg | ||
- name: Upload package | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: LibDeflate-${{ matrix.os }} | ||
path: pkg/* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Upload packages to feeds | ||
on: | ||
release: | ||
types: [created] | ||
workflow_dispatch: | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '6.0.x' # SDK Version to use. | ||
- name: Pack | ||
run: dotnet pack -c Release -o pkg | ||
- name: Publish the package to GPR | ||
run: dotnet nuget push pkg/*.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/jzebedee/index.json --skip-duplicate | ||
- name: Publish the package to NuGet | ||
run: dotnet nuget push pkg/*.nupkg -k ${{ secrets.LIBDEFLATE_NUGET_TOKEN }} -s https://api.nuget.org/v3/index.json --skip-duplicate |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using BenchmarkDotNet.Running; | ||
|
||
namespace LibDeflate.Benchmarks; | ||
|
||
public class Program | ||
{ | ||
public static void Main(string[] args) => BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args); | ||
} |