Skip to content

Continuous integration #636

Continuous integration

Continuous integration #636

Workflow file for this run

name: Continuous integration
on:
workflow_dispatch:
pull_request:
schedule:
# Run every day at midnight UTC
- cron: '0 0 * * *'
jobs:
tongsuo_clone:
# This step ensures that all builders have the same version of Tongsuo
runs-on: ubuntu-latest
steps:
- name: Clone Tongsuo repo
uses: actions/checkout@v4
with:
repository: Tongsuo-Project/Tongsuo
ref: 8.4-stable
path: Tongsuo
- name: Archive Tongsuo source
uses: actions/upload-artifact@v4
with:
name: tongsuo-source
path: ${{ github.workspace }}/Tongsuo
build-with-tongsuo-static:
needs: tongsuo_clone
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-13, macos-14, windows-latest]
runs-on: ${{ matrix.platform }}
timeout-minutes: 30
steps:
- name: Set up JDK 11 for toolchains
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
- name: Set runner-specific environment variables
shell: bash
run: |
echo "TONGSUO_HOME=${{ runner.temp }}/tongsuo" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Fetch Tongsuo source
run: gh run download --name tongsuo-source --dir ${{ github.workspace }}/Tongsuo
env:
GH_TOKEN: ${{ github.token }}
- name: Build Tongsuo on Linux or macOS
if: runner.os == 'Linux' || runner.os == 'macOS'
run: |
pushd ${{ github.workspace }}/Tongsuo
perl ./Configure --banner=Configured --prefix=$TONGSUO_HOME --libdir=$TONGSUO_HOME/lib enable-weak-ssl-ciphers enable-ntls no-shared
make -s -j4
make install
popd
- uses: ilammy/msvc-dev-cmd@v1
if: runner.os == 'Windows'
- uses: ilammy/setup-nasm@v1
if: runner.os == 'Windows'
- uses: shogo82148/actions-setup-perl@v1
if: runner.os == 'Windows'
- name: Build Tongsuo on Windows
if: runner.os == 'Windows'
run: |
cd ${{ github.workspace }}\Tongsuo
perl .\Configure --banner=Configured --prefix=$Env:TONGSUO_HOME no-capieng no-makedepend enable-weak-ssl-ciphers enable-ntls no-shared
nmake /S
nmake install
Get-ChildItem -Force -LiteralPath $Env:TONGSUO_HOME\lib
- name: Build with Gradle
shell: bash
run: |
./gradlew --version
./gradlew assemble -PcheckErrorQueue
- name: Test with Gradle
shell: bash
run: ./gradlew test -PcheckErrorQueue
- name: Other checks with Gradle
shell: bash
run: ./gradlew check -PcheckErrorQueue
- name: Build test JAR with dependencies
if: runner.os == 'Linux'
shell: bash
run: ./gradlew :tongsuo-openjdk:testJar -PcheckErrorQueue
- name: Upload test JAR with dependencies
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4
with:
name: testjar
path: openjdk/build/libs/tongsuo-openjdk-*-tests.jar
if-no-files-found: error
build-with-tongsuo-dynamic:
needs: tongsuo_clone
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-13, macos-14, windows-latest]
runs-on: ${{ matrix.platform }}
timeout-minutes: 30
steps:
- name: Set up JDK 11 for toolchains
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
- name: Set runner-specific environment variables
shell: bash
run: |
echo "TONGSUO_HOME=${{ runner.temp }}/tongsuo" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Fetch Tongsuo source
run: gh run download --name tongsuo-source --dir ${{ github.workspace }}/Tongsuo
env:
GH_TOKEN: ${{ github.token }}
- name: Build Tongsuo on Linux or macOS
if: runner.os == 'Linux' || runner.os == 'macOS'
run: |
pushd ${{ github.workspace }}/Tongsuo
perl ./Configure --banner=Configured --prefix=$TONGSUO_HOME --libdir=$TONGSUO_HOME/lib enable-weak-ssl-ciphers enable-ntls
make -s -j4
make install
popd
- uses: ilammy/msvc-dev-cmd@v1
if: runner.os == 'Windows'
- uses: ilammy/setup-nasm@v1
if: runner.os == 'Windows'
- uses: shogo82148/actions-setup-perl@v1
if: runner.os == 'Windows'
- name: Build Tongsuo on Windows
if: runner.os == 'Windows'
run: |
cd ${{ github.workspace }}\Tongsuo
perl .\Configure --banner=Configured --prefix=$Env:TONGSUO_HOME no-capieng no-makedepend enable-weak-ssl-ciphers enable-ntls
nmake /S
nmake install
Get-ChildItem -Force -LiteralPath $Env:TONGSUO_HOME\lib
- name: Copy tongsuo dynamic library to overwrite the system's library
if: runner.os == 'Windows'
run: |
$pathArray = $env:PATH -split ';'
foreach ($path in $pathArray) {
if (Test-Path -Path $path -PathType Container) {
$files = Get-ChildItem -Path $path -File
foreach ($file in $files) {
if ($file.Name -like '*libcrypto*') {
Write-Host $path
Copy-Item -Path "$Env:TONGSUO_HOME\bin\*.dll" -Destination $path -Force
break
}
}
}
}
- name: Set PATH for runtime library search
shell: perl {0}
if: runner.os == 'Windows'
run: |
use Actions::Core;
add_path("$ENV{RUNNER_TEMP}\\tongsuo\\bin");
add_path("$ENV{RUNNER_TEMP}\\tongsuo\\lib");
- name: Build with Gradle
shell: bash
run: ./gradlew assemble -PcheckErrorQueue -PtongsuoDynamic=1
- name: Test with Gradle on Windows or macOS
if: runner.os == 'Windows' || runner.os =='macOS'
shell: bash
run: ./gradlew test -PcheckErrorQueue -PtongsuoDynamic=1
- name: Test with Gradle on Linux
if: runner.os == 'Linux'
shell: bash
run: LD_LIBRARY_PATH=$TONGSUO_HOME/lib:$LD_LIBRARY_PATH ./gradlew test -PcheckErrorQueue -PtongsuoDynamic=1
- name: Other checks with Gradle on Windows or macOS
if: runner.os == 'Windows' || runner.os =='macOS'
shell: bash
run: ./gradlew check -PcheckErrorQueue -PtongsuoDynamic=1
- name: Other checks with Gradle on Linux
if: runner.os == 'Linux'
shell: bash
run: LD_LIBRARY_PATH=$TONGSUO_HOME/lib:$LD_LIBRARY_PATH ./gradlew check -PcheckErrorQueue -PtongsuoDynamic=1
- name: Build test JAR with dependencies based on Tongsuo dynamic library
if: runner.os == 'Linux'
shell: bash
run: ./gradlew :tongsuo-openjdk:testJar -PcheckErrorQueue -PtongsuoDynamic=1