Skip to content

Commit

Permalink
🎉 create project (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
Odonno committed Sep 22, 2023
1 parent 19792b6 commit bc82bd7
Show file tree
Hide file tree
Showing 191 changed files with 12,939 additions and 29 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/benchmark-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Benchmark PR Workflow

on:
pull_request:
branches:
- main

jobs:
action:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Download SurrealDB
run: curl --proto '=https' --tlsv1.2 -sSf https://install.surrealdb.com | sh

- name: Run SurrealDB root
run: surreal start --user root --pass root memory --auth --allow-guests &

- name: Setup dotnet 6.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: "6.0.x"

- name: Execute benchmarks
run: dotnet run -c Release --project SurrealDb.Benchmarks --filter '*'

- name: Download previous benchmark data
uses: actions/cache@v1
with:
path: ./cache
key: ${{ runner.os }}-benchmark

- name: Store benchmark result
uses: rhysd/github-action-benchmark@v1
with:
tool: "benchmarkdotnet"
output-file-path: BenchmarkDotNet.Artifacts/results/Combined.Benchmarks.json
external-data-json-path: ./cache/benchmark-data.json
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
summary-always: true
40 changes: 40 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Benchmark Workflow

on:
push:
branches:
- main

jobs:
action:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Download SurrealDB
run: curl --proto '=https' --tlsv1.2 -sSf https://install.surrealdb.com | sh

- name: Run SurrealDB root
run: surreal start --user root --pass root memory --auth --allow-guests &

- name: Setup dotnet 6.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: "6.0.x"

- name: Execute benchmarks
run: dotnet run -c Release --project SurrealDb.Benchmarks --filter '*'

- name: Download previous benchmark data
uses: actions/cache@v1
with:
path: ./cache
key: ${{ runner.os }}-benchmark

- name: Store benchmark result
uses: rhysd/github-action-benchmark@v1
with:
tool: "benchmarkdotnet"
output-file-path: BenchmarkDotNet.Artifacts/results/Combined.Benchmarks.json
external-data-json-path: ./cache/benchmark-data.json
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Main Workflow

on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Download SurrealDB
run: curl --proto '=https' --tlsv1.2 -sSf https://install.surrealdb.com | sh

- name: Run SurrealDB root
run: surreal start --user root --pass root memory --auth --allow-guests &

- name: Setup dotnet 6.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: "6.0.x"

- name: Install dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore --warnaserror

- name: Test
run: dotnet test --no-build
79 changes: 79 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Release Workflow

on:
release:
types: [created]

env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
NuGetDirectory: ${{ github.workspace }}/nuget

defaults:
run:
shell: pwsh

jobs:
create-package:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup dotnet 6.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: "6.0.x"

- name: Create Package
run: dotnet pack --configuration Release --output ${{ env.NuGetDirectory }}

- uses: actions/upload-artifact@v3
with:
name: nuget
if-no-files-found: error
retention-days: 7
path: ${{ env.NuGetDirectory }}/*.nupkg

validate-package:
needs: [create-package]
runs-on: ubuntu-latest

steps:
- name: Setup dotnet 6.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: "6.0.x"

- uses: actions/download-artifact@v3
with:
name: nuget
path: ${{ env.NuGetDirectory }}

- name: Install NuGet Package Validation Tool
run: dotnet tool update Meziantou.Framework.NuGetPackageValidation.Tool --global

- name: Validate package
run: meziantou.validate-nuget-package (Get-ChildItem "${{ env.NuGetDirectory }}/*.nupkg")

publish-package:
needs: [validate-package]
runs-on: ubuntu-latest

steps:
- name: Setup dotnet 6.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: "6.0.x"

- uses: actions/download-artifact@v3
with:
name: nuget
path: ${{ env.NuGetDirectory }}

- name: Publish NuGet package
run: |
foreach($file in (Get-ChildItem "${{ env.NuGetDirectory }}" -Recurse -Include *.nupkg)) {
dotnet nuget push $file --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
}
Loading

0 comments on commit bc82bd7

Please sign in to comment.