Skip to content

Test and build on-demand #19

Test and build on-demand

Test and build on-demand #19

name: Test and build on-demand
on:
workflow_dispatch:
inputs:
source-branch:
type: string
required: true
description: Branch to run test against
jobs:
make-matrix:
name: make input matrix
runs-on: ${{ vars.BUILD_CONTAINER_DISTRO_VERSION }}
outputs:
input-matrix: ${{ steps.set.outputs.input-matrix }}
java-version: ${{ steps.get-java-version.outputs.java-version }}
steps:
- uses: actions/checkout@v4 # brings versions.json into the workspace
with:
ref: ${{ github.ref }}
- id: create-server-matrix
uses: ./.github/actions/make-server-matrix
with:
default_json: ${{ vars.DEFAULT_SERVER_VERSIONS }}
test_servers_file_path: ${{ vars.TEST_SERVERS_FILE_PATH }}
- name: Get java version
id: get-java-version
run: |
echo java-version="$(grep '<java.version>' pom.xml | sed -e 's/<[^>]*>//g' | awk '{$1=$1};1' | sed 's/^1\.8$/8/')" >> $GITHUB_OUTPUT
- name: debug - print input variables
run: |
echo ${{ steps.get-java-version.outputs.java-version }}
echo ${{ steps.set.outputs.input-matrix }}
build-and-test:
uses: ./.github/workflows/test-branch.yaml
needs: make-matrix
strategy:
matrix:
entry: ${{ fromJson(needs.make-matrix.outputs.input-matrix) }}
crypto-type: [bouncycastle, gnu]
name: build-${{ matrix.entry.type }}-${{ matrix.entry.version }}
with:
java-version: ${{ needs.make-matrix.outputs.java-version }}
crypto-type: ${{ matrix.crypto-type }}
source-branch: ${{ inputs.source-branch }}
run-tests: true
server-tag: ${{ matrix.entry.version }}
server-type: ${{ matrix.entry.type }}
secrets: inherit