Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor template testing #4066

Closed
wants to merge 1 commit into from
Closed
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
31 changes: 31 additions & 0 deletions .github/actions/test-template/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: 'Test Template'
description: 'Tests a single template with given parameters'

inputs:
template:
description: 'The name of the template to test'
required: true
output:
description: 'The output directory for the template'
required: true
parameters:
description: 'template parameters'
required: false
default: ''

runs:
using: 'composite'
steps:
- name: Test template
shell: bash
run: |
set -e
dotnet new ${{ inputs.template }} -o ${{ inputs.output }} ${{ inputs.parameters }}
dotnet build ${{ inputs.output }}/ /p:TreatWarningsAsErrors=true
if: runner.os != 'Windows'
- name: Test template
shell: cmd
run: |
dotnet new ${{ inputs.template }} -o ${{ inputs.output }} ${{ inputs.parameters }}
dotnet build ${{ inputs.output }}/ /p:TreatWarningsAsErrors=true
if: runner.os == 'Windows'
224 changes: 116 additions & 108 deletions .github/actions/test-templates/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,161 +5,169 @@ runs:
steps:

# Protobuf Client template

- name: 🧪 Test IceRpc + Protobuf Client Template
run: |
dotnet new icerpc-protobuf-client -o templates-test/tcp/ProtobufClient
dotnet build templates-test/tcp/ProtobufClient/ /p:TreatWarningsAsErrors=true
shell: bash
uses: ./actions/test-template
with:
template: 'icerpc-protobuf-client'
output: 'templates-test/tcp/ProtobufClient'

- name: 🧪 Test IceRpc + Protobuf Client Template with Quic
run: |
dotnet new icerpc-protobuf-client -o templates-test/quic/ProtobufClient --transport quic
dotnet build templates-test/quic/ProtobufClient/ /p:TreatWarningsAsErrors=true
shell: bash
uses: ./actions/test-template
with:
template: 'icerpc-protobuf-client'
output: 'templates-test/quic/ProtobufClient'
parameters: '--transport quic'

- name: 🧪 Test IceRpc + Protobuf Client Template .NET 9
run: |
dotnet new icerpc-protobuf-client -o templates-test/net9.0/tcp/ProtobufClient -F net9.0
dotnet build templates-test/net9.0/tcp/ProtobufClient/ /p:TreatWarningsAsErrors=true
shell: bash
uses: ./actions/test-template
with:
template: 'icerpc-protobuf-client'
output: 'templates-test/net9.0/tcp/ProtobufClient'
parameters': '--Framework net9.0'

- name: 🧪 Test IceRpc + Protobuf Client Template with Quic and .NET9
run: |
dotnet new icerpc-protobuf-client -o templates-test/net9.0/quic/ProtobufClient --transport quic -F net9.0
dotnet build templates-test/net9.0/quic/ProtobufClient/ /p:TreatWarningsAsErrors=true
shell: bash
uses: ./actions/test-template
with:
template: 'icerpc-protobuf-client'
output: 'templates-test/net9.0/quic/ProtobufClient'
parameters: '--transport quic -Framework net9.0'

# Protobuf Server template

- name: 🧪 Test IceRpc + Protobuf Server Template
run: |
dotnet new icerpc-protobuf-server -o templates-test/tcp/ProtobufServer
dotnet build templates-test/tcp/ProtobufServer/ /p:TreatWarningsAsErrors=true
shell: bash
uses: ./actions/test-template
with:
template: 'icerpc-protobuf-server'
output: 'templates-test/tcp/ProtobufServer'

- name: 🧪 Test IceRpc + Protobuf Server Template with Quic
run: |
dotnet new icerpc-protobuf-server -o templates-test/quic/ProtobufServer --transport quic
dotnet build templates-test/quic/ProtobufServer/ /p:TreatWarningsAsErrors=true
shell: bash
uses: ./actions/test-template
with:
template: 'icerpc-protobuf-server'
output: 'templates-test/quic/ProtobufServer'
parameters: '--transport quic'

- name: 🧪 Test IceRpc + Protobuf Server Template .NET 9
run: |
dotnet new icerpc-protobuf-server -o templates-test/net9.0/tcp/ProtobufServer -F net9.0
dotnet build templates-test/net9.0/tcp/ProtobufServer/ /p:TreatWarningsAsErrors=true
shell: bash
uses: ./actions/test-template
with:
template: 'icerpc-protobuf-server'
output: 'templates-test/net9.0/tcp/ProtobufServer'
parameters: '--Framework net9.0'

- name: 🧪 Test IceRpc + Protobuf Server Template with Quic and .NET9
run: |
dotnet new icerpc-protobuf-server -o templates-test/net9.0/quic/ProtobufServer --transport quic -F net9.0
dotnet build templates-test/net9.0/quic/ProtobufServer/ /p:TreatWarningsAsErrors=true
shell: bash
uses: ./actions/test-template
with:
template: 'icerpc-protobuf-server'
output: 'templates-test/net9.0/quic/ProtobufServer'
parameters: '--transport quic -Framework net9.0'

# Slice Client template

- name: 🧪 Test IceRpc + Slice Client Template
run: |
dotnet new icerpc-slice-client -o templates-test/tcp/SliceClient
dotnet build templates-test/tcp/SliceClient/ /p:TreatWarningsAsErrors=true
shell: bash
uses: ./actions/test-template
with:
template: 'icerpc-slice-client'
output: 'templates-test/tcp/SliceClient'

- name: 🧪 Test IceRpc + Slice Client Template with Quic
run: |
dotnet new icerpc-slice-client -o templates-test/quic/SliceClient --transport quic
dotnet build templates-test/quic/SliceClient/ /p:TreatWarningsAsErrors=true
shell: bash
uses: ./actions/test-template
with:
template: 'icerpc-slice-client'
output: 'templates-test/quic/SliceClient'
parameters: '--transport quic'

- name: 🧪 Test IceRpc + Slice Client Template .NET 9
run: |
dotnet new icerpc-slice-client -o templates-test/net9.0/tcp/SliceClient -F net9.0
dotnet build templates-test/net9.0/tcp/SliceClient/ /p:TreatWarningsAsErrors=true
shell: bash

uses: ./actions/test-template
with:
template: 'icerpc-slice-client'
output: 'templates-test/net9.0/tcp/SliceClient'
parameters: '--Framework net9.0'

- name: 🧪 Test IceRpc + Slice Client Template with Quic and .NET9
run: |
dotnet new icerpc-slice-client -o templates-test/net9.0/quic/SliceClient --transport quic -F net9.0
dotnet build templates-test/net9.0/quic/SliceClient/ /p:TreatWarningsAsErrors=true
shell: bash
uses: ./actions/test-template
with:
template: 'icerpc-slice-client'
output: 'templates-test/net9.0/quic/SliceClient'
parameters: '--transport quic -Framework net9.0'

# Slice Server template

- name: 🧪 Test IceRpc + Slice Server Template
run: |
dotnet new icerpc-slice-server -o templates-test/tcp/SliceServer
dotnet build templates-test/tcp/SliceServer/ /p:TreatWarningsAsErrors=true
shell: bash
uses: ./actions/test-template
with:
template: 'icerpc-slice-server'
output: 'templates-test/tcp/SliceServer'

- name: 🧪 Test IceRpc + Slice Server Template with Quic
run: |
dotnet new icerpc-slice-server -o templates-test/quic/SliceServer --transport quic
dotnet build templates-test/quic/SliceServer/ /p:TreatWarningsAsErrors=true
shell: bash
uses: ./actions/test-template
with:
template: 'icerpc-slice-server'
output: 'templates-test/quic/SliceServer'
parameters: '--transport quic'

- name: 🧪 Test IceRpc + Slice Server Template .NET 9
run: |
dotnet new icerpc-slice-server -o templates-test/net9.0/tcp/SliceServer -F net9.0
dotnet build templates-test/net9.0/tcp/SliceServer/ /p:TreatWarningsAsErrors=true
shell: bash
uses: ./actions/test-template
with:
template: 'icerpc-slice-server'
output: 'templates-test/net9.0/tcp/SliceServer'
parameters: '--Framework net9.0'

- name: 🧪 Test IceRpc + Slice Server Template with Quic and .NET9
run: |
dotnet new icerpc-slice-server -o templates-test/net9.0/quic/SliceServer --transport quic -F net9.0
dotnet build templates-test/net9.0/quic/SliceServer/ /p:TreatWarningsAsErrors=true
shell: bash
uses: ./actions/test-template
with:
template: 'icerpc-slice-server'
output: 'templates-test/net9.0/quic/SliceServer'
parameters: '--transport quic -Framework net9.0'

# Protobuf DI Client template

- name: 🧪 Test IceRpc + Protobuf DI Client Template
run: |
dotnet new icerpc-protobuf-di-client -o templates-test/ProtobufDIClient
dotnet build templates-test/ProtobufDIClient/ /p:TreatWarningsAsErrors=true
shell: bash
uses: ./actions/test-template
with:
template: 'icerpc-protobuf-di-client'
output: 'templates-test/ProtobufDIClient'

- name: 🧪 Test IceRpc + Protobuf DI Client Template .NET 9
run: |
dotnet new icerpc-protobuf-di-client -o templates-test/net9.0/ProtobufDIClient -F net9.0
dotnet build templates-test/net9.0/ProtobufDIClient/ /p:TreatWarningsAsErrors=true
shell: bash
uses: ./actions/test-template
with:
template: 'icerpc-protobuf-di-client'
output: 'templates-test/net9.0/ProtobufDIClient'
parameters: '--Framework net9.0'

# Protobuf DI Server template

- name: 🧪 Test IceRpc + Protobuf DI Server Template
run: |
dotnet new icerpc-protobuf-di-server -o templates-test/ProtobufDIServer
dotnet build templates-test/ProtobufDIServer/ /p:TreatWarningsAsErrors=true
shell: bash
uses: ./actions/test-template
with:
template: 'icerpc-protobuf-di-server'
output: 'templates-test/ProtobufDIServer'

- name: 🧪 Test IceRpc + Protobuf DI Server Template .NET 9
run: |
dotnet new icerpc-protobuf-di-server -o templates-test/net9.0/ProtobufDIServer -F net9.0
dotnet build templates-test/net9.0/ProtobufDIServer/ /p:TreatWarningsAsErrors=true
shell: bash

# Slice DI Client template
uses: ./actions/test-template
with:
template: 'icerpc-protobuf-di-server'
output: 'templates-test/net9.0/ProtobufDIServer'
parameters: '--Framework net9.0'

# Slice DI Client template
- name: 🧪 Test IceRpc + Slice DI Client Template
run: |
dotnet new icerpc-slice-di-client -o templates-test/SliceDIClient
dotnet build templates-test/SliceDIClient/ /p:TreatWarningsAsErrors=true
shell: bash
uses: ./actions/test-template
with:
template: 'icerpc-slice-di-client'
output: 'templates-test/SliceDIClient'

- name: 🧪 Test IceRpc + Slice DI Client Template .NET 9
run: |
dotnet new icerpc-slice-di-client -o templates-test/net9.0/SliceDIClient -F net9.0
dotnet build templates-test/net9.0/SliceDIClient/ /p:TreatWarningsAsErrors=true
shell: bash
uses: ./actions/test-template
with:
template: 'icerpc-slice-di-client'
output: 'templates-test/net9.0/SliceDIClient'
parameters: '--Framework net9.0'

# Slice DI Server template

- name: 🧪 Test IceRpc + Slice DI Server Template
run: |
dotnet new icerpc-slice-di-server -o templates-test/SliceDIServer
dotnet build templates-test/SliceDIServer/ /p:TreatWarningsAsErrors=true
shell: bash
uses: ./actions/test-template
with:
template: 'icerpc-slice-di-server'
output: 'templates-test/SliceDIServer'

- name: 🧪 Test IceRpc + Slice DI Server Template .NET 9
run: |
dotnet new icerpc-slice-di-server -o templates-test/net9.0/SliceDIServer -F net9.0
dotnet build templates-test/net9.0/SliceDIServer/ /p:TreatWarningsAsErrors=true
shell: bash
uses: ./actions/test-template
with:
template: 'icerpc-slice-di-server'
output: 'templates-test/net9.0/SliceDIServer'
parameters: '--Framework net9.0'
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ on:

jobs:
build_and_test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 10
steps:
- name: Checkout
Expand Down
Loading