Skip to content

feat: updated SDKs with the latest API (#43) #167

feat: updated SDKs with the latest API (#43)

feat: updated SDKs with the latest API (#43) #167

Workflow file for this run

name: Build & Test
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
checks: write
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build Projects
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.x.x
- name: Restore Packages
run: dotnet restore --nologo
- name: Build
run: dotnet build --no-restore --nologo --configuration Release
- name: Cache Build
uses: actions/cache/save@v4
with:
path: .
key: build-${{ github.run_id }}-${{ github.run_attempt }}
lint-dotnet:
name: Lint DotNet
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.x.x
- name: Install Tool
run: dotnet tool restore || true
- name: Lint DotNet
id: lint_dotnet
run: |
dotnet format --verify-no-changes
test:
name: Management SDK Unit Tests
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.x.x
- name: Load Cache
uses: actions/cache/restore@v4
with:
path: .
key: build-${{ github.run_id }}-${{ github.run_attempt }}
- name: Test
run: dotnet test src/management/tests/MonoCloud.Management.UnitTests/MonoCloud.Management.UnitTests.csproj --no-build --nologo --configuration Release --logger "trx;LogFileName=MonoCloud.Management.UnitTests.trx"
- name: Upload test results
id: upload_artifact
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: MonoCloud.Management.UnitTests
path: "**/*.trx"
overwrite: true
- name: Report Unit Test Results
if: success() || failure()
uses: dorny/test-reporter@v1
with:
artifact: MonoCloud.Management.UnitTests
name: "Management SDK Unit Tests"
path: "**/*.trx"
reporter: dotnet-trx
fail-on-error: false