Skip to content
Merged

V7 #179

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 19 additions & 20 deletions .github/actions/push-package/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ inputs:
default: 'false'
required: false
config:
description: 'The build configuration (Build or Release)'
description: 'The build configuration (Debug or Release)'
default: Release
required: true
version:
description: 'The package version'
required: true
ghapikey:
description: 'The Git Hub Api Key for package feed'
description: 'The GitHub API Key for package feed'
required: true
nugetapikey:
description: 'The Nuget Api Key for package feed'
description: 'The NuGet API Key for package feed'
required: true
registry:
description: 'The package registry (oneimlx or nuget)'
default: oneimlx
description: 'The package registry (GitHub or NuGet)'
default: github
required: true
runs:
using: "composite"
Expand All @@ -33,11 +33,11 @@ runs:
- name: Build
run: dotnet build ./src/${{ inputs.project }}/${{ inputs.project }}.csproj -c ${{ inputs.config }} --verbosity minimal
shell: bash
# Test

# Test and collect coverage
- name: Test
if: ${{ inputs.skiptest == 'false' }}
run: dotnet test ./test/${{ inputs.project }}.Tests/${{ inputs.project }}.Tests.csproj -c ${{ inputs.config }} --verbosity minimal
run: dotnet test ./test/${{ inputs.project }}.Tests/${{ inputs.project }}.Tests.csproj -c ${{ inputs.config }} --verbosity minimal --collect:"XPlat Code Coverage" --results-directory ./coverage --filter "Category!=Performance"
shell: bash

# Pack
Expand All @@ -47,22 +47,21 @@ runs:
dotnet pack ./src/${{ inputs.project }}/${{ inputs.project }}.csproj -p:PackageVersion=${{ inputs.version }} --no-build -c ${{ inputs.config }} -o _packages -v minimal
shell: bash

# GITHUB
- name: Github Push
if: ${{ inputs.registry == 'oneimlx' }}
run: dotnet nuget push _packages/${{ inputs.project }}.${{ inputs.version }}.nupkg --skip-duplicate --no-symbols --api-key ${{ inputs.ghapikey }} --source oneimlx
# GitHub Feed
- name: GitHub Push
if: ${{ inputs.registry == 'github' }}
run: dotnet nuget push _packages/${{ inputs.project }}.${{ inputs.version }}.nupkg --skip-duplicate --no-symbols --api-key ${{ inputs.ghapikey }} --source github
shell: bash

# NUGET - 1
# First push to github (for package cadence, Nuget requires package verification)
- name: Github Push
# NuGet Feed
# First push to GitHub (for package cadence, NuGet requires package verification)
- name: GitHub Push
if: ${{ inputs.registry == 'nuget' }}
run: dotnet nuget push _packages/${{ inputs.project }}.${{ inputs.version }}.nupkg --skip-duplicate --no-symbols --api-key ${{ inputs.ghapikey }} --source oneimlx
run: dotnet nuget push _packages/${{ inputs.project }}.${{ inputs.version }}.nupkg --skip-duplicate --no-symbols --api-key ${{ inputs.ghapikey }} --source github
shell: bash

# NUGET - 2
# Second push to Nuget (for package cadence, Github will be used and in production Nuget after package verification)
- name: Nuget Push

# Second push
- name: NuGet Push
if: ${{ inputs.registry == 'nuget' }}
run: dotnet nuget push _packages/${{ inputs.project }}.${{ inputs.version }}.nupkg --skip-duplicate --no-symbols --api-key ${{ inputs.nugetapikey }} --source nuget.org
shell: bash
20 changes: 10 additions & 10 deletions .github/workflows/build-test-cross.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

# Checkout
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6

# Read env
- name: Read Env
Expand All @@ -38,7 +38,7 @@ jobs:

# Setup .Net with global.json
- name: Setup .NET
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5

# Build
- name: Restore & Build
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:

# Checkout
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v6

# Read env
- name: Read Env
Expand All @@ -75,17 +75,17 @@ jobs:

# Setup .Net with global.json
- name: Setup .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v5

# Build
- name: Restore & Build
run: dotnet build "OneImlx.Terminal.Solution.slnx"

# Test
- name: Test
run: dotnet test "OneImlx.Terminal.Solution.slnx" --no-build --verbosity normal
windows:

windows:
runs-on: windows-latest
timeout-minutes: 15

Expand All @@ -103,7 +103,7 @@ jobs:

# Checkout
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v6

# Read env
- name: Read Env
Expand All @@ -112,7 +112,7 @@ jobs:

# Setup .Net with global.json
- name: Setup .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v5

# Build
- name: Restore & Build
Expand Down
74 changes: 64 additions & 10 deletions .github/workflows/build-test-push.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# Copyright (c) 2026 Perpetual Intelligence L.L.C. All Rights Reserved.
# Copyright (c) Perpetual Intelligence L.L.C. All Rights Reserved.
#
# For license, terms, and data policies, go to:
# https://terms.perpetualintelligence.com

name: build-test-push

concurrency: github-release
# 1 release at a time
concurrency: ${{ github.event.repository.name }}

# Manual trigger for deployment
# CICD. The rc and release are a manual trigger
on:
push:
branches: [ main ]
Expand All @@ -29,9 +30,9 @@ on:
description: 'The package registry'
required: true
options:
- oneimlx
- github
- nuget
default: oneimlx
default: github

jobs:
setup:
Expand All @@ -44,17 +45,17 @@ jobs:
PI_GITHUB_USERNAME_ENV: ${{ secrets.PI_GITHUB_USERNAME }}
PI_GITHUB_PAT_ENV: ${{ secrets.PI_GITHUB_PAT }}
PI_NUGET_PAT_ENV: ${{ secrets.PI_NUGET_API_KEY }}
PI_PUBLISH_REGISTRY: oneimlx
PI_PUBLISH_REGISTRY: github
PI_CI_REFERENCE: package
PI_TERMINAL_TEST_ONLINE_LIC: ${{ secrets.PI_TERMINAL_TEST_ONLINE_LIC }}
PI_TERMINAL_TEST_OFFLINE_LIC: ${{ secrets.PI_TERMINAL_TEST_OFFLINE_LIC }}
PI_TERMINAL_TEST_DEMO_LIC: ${{ secrets.PI_TERMINAL_TEST_DEMO_LIC }}

steps:

# Checktout
# Checkout
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6

# Print directory
- name: Print
Expand Down Expand Up @@ -120,14 +121,20 @@ jobs:

# Setup .Net with global.json
- name: Setup .NET
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5

# Setup ReportGenerator
- name: Setup ReportGenerator
run: dotnet tool install --global dotnet-reportgenerator-globaltool
shell: bash

# Build Terminal.DependentAssembly.csproj so it can be loaded during unit tests.
- name: Build Dependency Project
run: dotnet build ./test/OneImlx.Terminal.DependentAssembly/OneImlx.Terminal.DependentAssembly.csproj -c Release --verbosity minimal

# Publish OneImlx.Terminal.Shared
- name: OneImlx.Terminal.Shared
id: oneimlx-terminal-shared
uses: ./.github/actions/push-package
with:
project: OneImlx.Terminal.Shared
Expand All @@ -139,6 +146,7 @@ jobs:

# Publish OneImlx.Terminal
- name: OneImlx.Terminal
id: oneimlx-terminal
uses: ./.github/actions/push-package
with:
project: OneImlx.Terminal
Expand All @@ -150,6 +158,7 @@ jobs:

# Publish OneImlx.Terminal.Server
- name: OneImlx.Terminal.Server
id: oneimlx-terminal-server
uses: ./.github/actions/push-package
with:
project: OneImlx.Terminal.Server
Expand All @@ -161,6 +170,7 @@ jobs:

# Publish OneImlx.Terminal.Server.Grpc
- name: OneImlx.Terminal.Server.Grpc
id: oneimlx-terminal-server-grpc
uses: ./.github/actions/push-package
with:
project: OneImlx.Terminal.Server.Grpc
Expand All @@ -172,6 +182,7 @@ jobs:

# Publish OneImlx.Terminal.Server.Pulsar
- name: OneImlx.Terminal.Server.Pulsar
id: oneimlx-terminal-server-pulsar
uses: ./.github/actions/push-package
with:
project: OneImlx.Terminal.Server.Pulsar
Expand All @@ -183,6 +194,7 @@ jobs:

# Publish OneImlx.Terminal.Client
- name: OneImlx.Terminal.Client
id: oneimlx-terminal-client
uses: ./.github/actions/push-package
with:
project: OneImlx.Terminal.Client
Expand All @@ -194,6 +206,7 @@ jobs:

# Publish OneImlx.Terminal.Client.Grpc
- name: OneImlx.Terminal.Client.Grpc
id: oneimlx-terminal-client-grpc
uses: ./.github/actions/push-package
with:
project: OneImlx.Terminal.Client.Grpc
Expand All @@ -203,8 +216,9 @@ jobs:
nugetapikey: ${{ env.PI_NUGET_PAT_ENV }}
registry: ${{ env.PI_PUBLISH_REGISTRY }}

# Publish OneImlx.Terminal.Server.Pulsar
# Publish OneImlx.Terminal.Client.Pulsar
- name: OneImlx.Terminal.Client.Pulsar
id: oneimlx-terminal-client-pulsar
uses: ./.github/actions/push-package
with:
project: OneImlx.Terminal.Client.Pulsar
Expand All @@ -216,6 +230,7 @@ jobs:

# Publish OneImlx.Terminal.Authentication
- name: OneImlx.Terminal.Authentication
id: oneimlx-terminal-authentication
uses: ./.github/actions/push-package
with:
project: OneImlx.Terminal.Authentication
Expand All @@ -224,3 +239,42 @@ jobs:
ghapikey: ${{ env.PI_GITHUB_PAT_ENV }}
nugetapikey: ${{ env.PI_NUGET_PAT_ENV }}
registry: ${{ env.PI_PUBLISH_REGISTRY }}

# Aggregate coverage report across all packages deposited into ./coverage
- name: Coverage Report
run: reportgenerator -reports:./coverage/**/coverage.cobertura.xml -targetdir:./coverage/report -reporttypes:JsonSummary
shell: bash

# Extract aggregate line and branch coverage
- name: Extract Coverage
id: coverage
run: |
echo "line=$(jq '.summary.linecoverage' ./coverage/report/Summary.json | xargs printf '%.0f')" >> $GITHUB_OUTPUT
echo "branch=$(jq '.summary.branchcoverage' ./coverage/report/Summary.json | xargs printf '%.0f')" >> $GITHUB_OUTPUT
shell: bash

# Update line coverage badge in Gist
- name: Line Coverage Badge
uses: Schneegans/dynamic-badges-action@v1.8.0
with:
auth: ${{ secrets.PI_GITHUB_GIST_PAT }}
gistID: ${{ secrets.PI_GITHUB_GIST_ID }}
filename: coverage_${{ github.event.repository.name }}_line.json
label: coverage-line
message: ${{ steps.coverage.outputs.line }}%
valColorRange: ${{ steps.coverage.outputs.line }}
maxColorRange: 100
minColorRange: 0

# Update branch coverage badge in Gist
- name: Branch Coverage Badge
uses: Schneegans/dynamic-badges-action@v1.8.0
with:
auth: ${{ secrets.PI_GITHUB_GIST_PAT }}
gistID: ${{ secrets.PI_GITHUB_GIST_ID }}
filename: coverage_${{ github.event.repository.name }}_branch.json
label: coverage-branch
message: ${{ steps.coverage.outputs.branch }}%
valColorRange: ${{ steps.coverage.outputs.branch }}
maxColorRange: 100
minColorRange: 0
Loading
Loading