ci: Add TLS support for Mock #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | ||
on: | ||
pull_request: | ||
concurrency: | ||
group: test-${{ github.ref }} | ||
cancel-in-progress: true | ||
jobs: | ||
certs: | ||
name: Generate certificates | ||
runs-on: ubuntu-latest | ||
outputs: | ||
client-ca_key: ${{ steps.certs.outputs.client-ca_key }} | ||
client-ca_pem: ${{ steps.certs.outputs.client-ca_pem }} | ||
client_key: ${{ steps.certs.outputs.client_key }} | ||
client_pem: ${{ steps.certs.outputs.client_pem }} | ||
server-ca_key: ${{ steps.certs.outputs.server-ca_key }} | ||
server-ca_pem: ${{ steps.certs.outputs.server-ca_pem }} | ||
server_key: ${{ steps.certs.outputs.server_key }} | ||
server_pem: ${{ steps.certs.outputs.server_pem }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Generate certificates | ||
id: certs | ||
run: | | ||
mkdir certs | ||
cd certs | ||
../scripts/certs.sh | ||
for file in *; do | ||
echo "${file//./_}<<EOF" | ||
cat "$file" | ||
echo "EOF" | ||
done >> "$GITHUB_OUTPUT" | ||
csharp: | ||
name: Test C# | ||
needs: | ||
- certs | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
dotnet: | ||
- version: "" | ||
framework: "net4.7" | ||
- version: "" | ||
framework: "net4.8" | ||
- version: "6.0" | ||
framework: "net6.0" | ||
- version: "8.0" | ||
framework: "net8.0" | ||
platform: | ||
- os: ubuntu-latest | ||
runtime: linux-x64 | ||
- os: windows-latest | ||
runtime: windows-x64 | ||
exclude: | ||
- dotnet: | ||
version: "" | ||
framework: "net4.7" | ||
platform: | ||
os: ubuntu-latest | ||
runtime: linux-x64 | ||
- dotnet: | ||
version: "" | ||
framework: "net4.8" | ||
platform: | ||
os: ubuntu-latest | ||
runtime: linux-x64 | ||
runs-on: ${{ matrix.platform.os }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install certs | ||
working-directory: packages/chsarp/ | ||
shell: bash | ||
run: | | ||
Check failure on line 84 in .github/workflows/test.yml GitHub Actions / TestsInvalid workflow file
|
||
mkdir certs | ||
cd certs | ||
cat > client-ca.key <<EOF | ||
${{ jobs.certs.outputs.client-ca_key }} | ||
EOF | ||
cat > client-ca.pem <<EOF | ||
${{ jobs.certs.outputs.client-ca_pem }} | ||
EOF | ||
cat > client.key <<EOF | ||
${{ jobs.certs.outputs.client_key }} | ||
EOF | ||
cat > client.pem <<EOF | ||
${{ jobs.certs.outputs.client_pem }} | ||
EOF | ||
cat > server-ca.key <<EOF | ||
${{ jobs.certs.outputs.server-ca_key }} | ||
EOF | ||
cat > server-ca.pem <<EOF | ||
${{ jobs.certs.outputs.server-ca_pem }} | ||
EOF | ||
cat > server.key <<EOF | ||
${{ jobs.certs.outputs.server_key }} | ||
EOF | ||
cat > server.pem <<EOF | ||
${{ jobs.certs.outputs.server_pem }} | ||
EOF | ||
- name: Install .NET Core | ||
uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4 | ||
if: ${{ matrix.dotnet.version }} != "" | ||
with: | ||
dotnet-version: ${{ matrix.dotnet.version }} | ||
- name: Test | ||
working-directory: packages/chsarp/ | ||
shell: bash | ||
run: | | ||
dotnet run --project ArmoniK.Api.Mock -- grpc:port=5000 http:port=4999 & notls_pid=$! | ||
dotnet run --project ArmoniK.Api.Mock -- grpc:port=5001 http:port=5001 http:cert=certs/server.pem http:key=certs/server.key & tls_pid=$! | ||
dotnet run --project ArmoniK.Api.Mock -- grpc:port=5002 http:port=5001 http:cert=certs/server.pem http:key=certs/server.key http:clientcert=certs/client-ca.pem & mtls_pid=$! | ||
dotnet test --project ArmoniK.Api.Client.Tests --runtime ${{ matrix.platform.runtime }} -f ${{ matrix.dotnet.framework }} --logger "trx;LogFileName=test-results.trx"; ret=$? | ||
kill $notls_pid $tls_pid $mtls_pid | ||
exit $ret | ||
- name: Test Report | ||
uses: dorny/test-reporter@v1 | ||
if: always() | ||
with: | ||
name: ConnectivityTests ${{ matrix.platform.runtime }} ${{ matrix.dotnet.framework }} | ||
path: ./packages/chsarp/tests/TestResults/test-results.trx | ||
reporter: dotnet-trx |