Skip to content

Commit

Permalink
feat: first alpha version
Browse files Browse the repository at this point in the history
  • Loading branch information
hermogenes committed Jul 10, 2024
1 parent 013273c commit cd7f99d
Show file tree
Hide file tree
Showing 55 changed files with 5,531 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
services:
libsql-server:
image: ghcr.io/tursodatabase/libsql-server:latest
ports:
- "9080:8080"
volumes:
- libsql-server-data:/var/lib/sqld

volumes:
libsql-server-data:
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

[*]

# ReSharper properties
resharper_csharp_wrap_after_declaration_lpar = true
resharper_csharp_wrap_after_invocation_lpar = true
resharper_csharp_wrap_arguments_style = chop_if_long
resharper_csharp_wrap_parameters_style = chop_if_long
resharper_place_expr_method_on_single_line = if_owner_is_single_line
101 changes: 101 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Continuous Integration

on:
workflow_dispatch:
inputs:
run-publish:
description: "Run publish job"
required: false
default: false
type: boolean
push:
pull_request:
branches:
- main
release:
types:
- published

env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true

jobs:
build:
runs-on: ubuntu-latest
outputs:
packed-files: ${{ steps.packed-files.outputs.result }}

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

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Restore dependencies
run: dotnet restore

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

- name: Run tests
run: dotnet test --configuration Release --collect:"XPlat Code Coverage;Format=opencover,lcov,cobertura" --logger trx --no-build

- name: Report results
uses: bibipkins/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-title: "Unit Test Results"
results-path: ./test/**/TestResults/*.trx
coverage-path: ./test/**/TestResults/**/coverage.opencover.xml
coverage-threshold: 80

- run: dotnet pack --configuration Release --output ${{ github.workspace }}/nuget

# Publish the NuGet package as an artifact, so they can be used in the following jobs
- uses: actions/upload-artifact@v4
with:
name: nuget
if-no-files-found: error
retention-days: 7
path: ${{ github.workspace }}/nuget/*.nupkg

- uses: actions/github-script@v7
id: packed-files
with:
script: |
const globber = await glob.create('${{ github.workspace }}/nuget/*.nupkg')
const files = await globber.glob()
return JSON.stringify(files.map(file => file.replace('${{ github.workspace }}/nuget/', '')))
result-encoding: string

publish:
if: ${{ github.event_name == 'release' || github.event.inputs.run-publish }}
runs-on: ubuntu-latest
name: Publish ${{ matrix.package }}
needs: build
strategy:
matrix:
package: ${{fromJson(needs.build.outputs.packed-files)}}
steps:
- uses: actions/download-artifact@v4
with:
name: nuget
path: ${{ github.workspace }}/nuget

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Publish NuGet package
run: dotnet nuget push ${{ github.workspace }}/nuget/${{matrix.package}} --api-key "${{ secrets.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
Loading

0 comments on commit cd7f99d

Please sign in to comment.