From 304ac88729a78615bd64c151be6fc9884429edf9 Mon Sep 17 00:00:00 2001 From: Odonno Date: Sun, 1 Oct 2023 16:57:03 +0200 Subject: [PATCH] Configure CI/CD --- .github/codecov.yml | 2 + .github/labeler.yml | 3 + .../workflows/healthchecks_surrealdb_cd.yml | 29 ++++++++ .../healthchecks_surrealdb_cd_preview.yml | 30 ++++++++ .../workflows/healthchecks_surrealdb_ci.yml | 73 +++++++++++++++++++ 5 files changed, 137 insertions(+) create mode 100644 .github/workflows/healthchecks_surrealdb_cd.yml create mode 100644 .github/workflows/healthchecks_surrealdb_cd_preview.yml create mode 100644 .github/workflows/healthchecks_surrealdb_ci.yml diff --git a/.github/codecov.yml b/.github/codecov.yml index 8ef912e73d..71c9c6c62c 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -101,6 +101,8 @@ flags: carryforward: true SqlServer: carryforward: true + SurrealDb: + carryforward: true System: carryforward: true UI: diff --git a/.github/labeler.yml b/.github/labeler.yml index 87db1be728..31ed546475 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -132,6 +132,9 @@ sqlite: sqlserver: - src/HealthChecks.SqlServer/**/* +surrealdb: + - src/HealthChecks.SurrealDb/**/* + system: - src/HealthChecks.System/**/* diff --git a/.github/workflows/healthchecks_surrealdb_cd.yml b/.github/workflows/healthchecks_surrealdb_cd.yml new file mode 100644 index 0000000000..ebede5b337 --- /dev/null +++ b/.github/workflows/healthchecks_surrealdb_cd.yml @@ -0,0 +1,29 @@ +name: HealthChecks SurrealDB CD + +on: + push: + tags: + - release-surrealdb-* + - release-all-* + +jobs: + build: + env: + BUILD_CONFIG: Release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: | + 6.0.x + 7.0.x + - name: Restore + run: dotnet restore ./src/HealthChecks.SurrealDb/HealthChecks.SurrealDb.csproj + - name: Build + run: dotnet build --no-restore ./src/HealthChecks.SurrealDb/HealthChecks.SurrealDb.csproj -c $BUILD_CONFIG + - name: Pack + run: dotnet pack --no-build ./src/HealthChecks.SurrealDb/HealthChecks.SurrealDb.csproj -c $BUILD_CONFIG -o ./artifacts + - name: Publish + run: dotnet nuget push ./artifacts/AspNetCore.HealthChecks.SurrealDb.*.nupkg -k ${{secrets.NUGET_API_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate diff --git a/.github/workflows/healthchecks_surrealdb_cd_preview.yml b/.github/workflows/healthchecks_surrealdb_cd_preview.yml new file mode 100644 index 0000000000..1fa2882fad --- /dev/null +++ b/.github/workflows/healthchecks_surrealdb_cd_preview.yml @@ -0,0 +1,30 @@ +name: HealthChecks SurrealDB Preview CD + +on: + push: + tags: + - preview-surrealdb-* + - preview-all-* + +jobs: + build: + env: + BUILD_CONFIG: Release + VERSION_SUFFIX: rc2.${{ github.run_number }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: | + 6.0.x + 7.0.x + - name: Restore + run: dotnet restore ./src/HealthChecks.SurrealDb/HealthChecks.SurrealDb.csproj + - name: Build + run: dotnet build --no-restore ./src/HealthChecks.SurrealDb/HealthChecks.SurrealDb.csproj -c $BUILD_CONFIG + - name: Pack + run: dotnet pack --no-build ./src/HealthChecks.SurrealDb/HealthChecks.SurrealDb.csproj --version-suffix $VERSION_SUFFIX -c $BUILD_CONFIG -o ./artifacts + - name: Publish + run: dotnet nuget push ./artifacts/AspNetCore.HealthChecks.SurrealDb.*.nupkg -k ${{secrets.NUGET_API_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate diff --git a/.github/workflows/healthchecks_surrealdb_ci.yml b/.github/workflows/healthchecks_surrealdb_ci.yml new file mode 100644 index 0000000000..08ec9c6529 --- /dev/null +++ b/.github/workflows/healthchecks_surrealdb_ci.yml @@ -0,0 +1,73 @@ +name: HealthChecks SurrealDB CI + +on: + workflow_dispatch: + push: + branches: [master] + paths: + - src/HealthChecks.SurrealDb/** + - test/HealthChecks.SurrealDb.Tests/** + - test/_SHARED/** + - .github/workflows/healthchecks_surrealdb_ci.yml + - Directory.Build.props + - Directory.Build.targets + tags-ignore: + - release-* + - preview-* + + pull_request: + branches: [master] + paths: + - src/HealthChecks.SurrealDb/** + - test/HealthChecks.SurrealDb.Tests/** + - test/_SHARED/** + - .github/workflows/healthchecks_surrealdb_ci.yml + - Directory.Build.props + - Directory.Build.targets + +jobs: + build: + runs-on: ubuntu-latest + services: + surrealdb: + image: surrealdb/surrealdb + ports: + - 8000:8000 + env: + SURREAL_USER: root + SURREAL_PASS: root + steps: + - uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: | + 6.0.x + 7.0.x + - name: Restore + run: | + dotnet restore ./src/HealthChecks.SurrealDb/HealthChecks.SurrealDb.csproj && + dotnet restore ./test/HealthChecks.SurrealDb.Tests/HealthChecks.SurrealDb.Tests.csproj + - name: Check formatting + run: | + dotnet format --no-restore --verify-no-changes --severity warn ./src/HealthChecks.SurrealDb/HealthChecks.SurrealDb.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1) && + dotnet format --no-restore --verify-no-changes --severity warn ./test/HealthChecks.SurrealDb.Tests/HealthChecks.SurrealDb.Tests.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1) + - name: Build + run: | + dotnet build --no-restore ./src/HealthChecks.SurrealDb/HealthChecks.SurrealDb.csproj && + dotnet build --no-restore ./test/HealthChecks.SurrealDb.Tests/HealthChecks.SurrealDb.Tests.csproj + - name: Test + run: > + dotnet test + ./test/HealthChecks.SurrealDb.Tests/HealthChecks.SurrealDb.Tests.csproj + --no-restore + --no-build + --collect "XPlat Code Coverage" + --results-directory .coverage + -- + DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover + - name: Upload Coverage + uses: codecov/codecov-action@v3 + with: + flags: SurrealDb + directory: .coverage