Skip to content

.NET Runtime OpenSSL CI #172

.NET Runtime OpenSSL CI

.NET Runtime OpenSSL CI #172

Workflow file for this run

name: .NET Runtime OpenSSL CI
on:
schedule:
- cron: '0 13 * * 1,4'
workflow_dispatch:
inputs:
openssl_ref:
type: string
description: openssl/openssl Branch
required: true
default: 'master'
runtime_ref:
type: string
description: dotnet/runtime Branch
required: true
default: 'main'
portable_build:
type: boolean
default: true
description: portable build
run_networking:
type: boolean
default: false
description: run networking
permissions:
actions: write
contents: read
issues: write
packages: read
jobs:
run:
runs-on: ubuntu-24.04-arm
container:
image: ghcr.io/vcsjones/runtime-ci:main
steps:
- name: Checkout .NET Runtime
uses: actions/checkout@v4
id: checkout-dotnet
with:
repository: dotnet/runtime
path: runtime
ref: ${{ inputs.runtime_ref || 'main' }}
- name: Checkout OpenSSL
uses: actions/checkout@v4
id: checkout-openssl
with:
repository: openssl/openssl
path: openssl
ref: ${{ inputs.openssl_ref || 'master' }}
- name: Log Details
run: |
echo openssl/openssl ref: ${{ steps.checkout-openssl.outputs.commit }}
echo dotnet/runtime ref: ${{ steps.checkout-dotnet.outputs.commit }}
if [ "${{ inputs.portable_build }}" = "false" ]; then
echo "nonportable build"
else
echo "portable build"
fi
- name: OpenSSL Build Cache Restore
id: openssl-build-cache
uses: actions/cache/restore@v4
with:
path: |
${{ github.workspace }}/openssl
!${{ github.workspace }}/openssl/.git
key: ${{ runner.os }}-${{ runner.arch }}-${{ steps.checkout-openssl.outputs.commit }}-openssl
- name: Build OpenSSL
if: steps.openssl-build-cache.outputs.cache-hit != 'true'
id: build-openssl
run: |
cd $GITHUB_WORKSPACE/openssl
./config -shared --prefix=/opt/openssl --openssldir=/opt/openssl
make -j 4
- name: OpenSSL Build Cache Save
uses: actions/cache/save@v4
if: steps.build-openssl.outcome == 'success'
with:
path: |
${{ github.workspace }}/openssl
!${{ github.workspace }}/openssl/.git
key: ${{ runner.os }}-${{ runner.arch }}-${{ steps.checkout-openssl.outputs.commit }}-openssl
- name: Install OpenSSL
run: |
cd $GITHUB_WORKSPACE/openssl
make install_sw
- name: Build .NET
env:
OPENSSL_ROOT_DIR: /opt/openssl
run: |
cd $GITHUB_WORKSPACE/runtime
./build.sh -rc release -s clr+libs /p:NativeOptimizationDataSupported=false
if [ "${{ inputs.portable_build }}" = "false" ]; then
./build.sh -rc release -s libs.native --portablebuild false
fi
- name: .NET Cryptography Tests
env:
LD_LIBRARY_PATH: /opt/openssl/lib
OPENSSL_ROOT_DIR: /opt/openssl
shell: bash
run: |
set +e
cd $GITHUB_WORKSPACE/runtime
./dotnet.sh test src/libraries/System.Security.Cryptography/tests
SSC_RESULT=$?
./dotnet.sh test src/libraries/Microsoft.Bcl.Cryptography/tests
MBC_RESULT=$?
echo "SSC_RESULT: $SSC_RESULT; MBC_RESULT: $MBC_RESULT"
if [ $SSC_RESULT -ne 0 ] || [ $MBC_RESULT -ne 0 ]; then
exit 1
else
exit 0
fi
- name: Run Networking Tests
if: inputs.run_networking
env:
LD_LIBRARY_PATH: /opt/openssl/lib
OPENSSL_ROOT_DIR: /opt/openssl
shell: bash
run: |
set +e
cd $GITHUB_WORKSPACE/runtime
./dotnet.sh test src/libraries/System.Net.Security/tests/UnitTests/
SNSU_RESULT=$?
./dotnet.sh test src/libraries/System.Net.Security/tests/FunctionalTests/
SNSF_RESULT=$?
echo "SNSU_RESULT: $SNSU_RESULT; SNSF_RESULT: $SNSF_RESULT"
if [ $SNSU_RESULT -ne 0 ] || [ $SNSF_RESULT -ne 0 ]; then
exit 1
else
exit 0
fi
- name: Upload Test Results
if: ${{ success() || failure() }}
uses: actions/upload-artifact@v4
with:
path: |
${{ github.workspace }}/runtime/artifacts/bin/**/TestResults/
if-no-files-found: warn
retention-days: 7
- name: Open Failure Issue
if: ${{ failure() && github.event_name == 'schedule' }}
uses: actions/github-script@v7
with:
script: |
await github.rest.issues.create({
owner: "vcsjones",
repo: "runtime-ci",
title: "Build Failure for run ${{ github.run_id }}",
body: "There was a CI build failure. Go look at ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
});