Skip to content

Commit 4a47543

Browse files
committed
updatd manual test-flows
1 parent f430678 commit 4a47543

File tree

3 files changed

+64
-21
lines changed

3 files changed

+64
-21
lines changed

.github/actions/build-and-test/action.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ inputs:
66
description: "Crypto type to use. This should either be bouncycastle or gnu"
77
required: false
88
default: gnu
9-
use-server-rc:
10-
required: false
11-
default: "false"
12-
description: "Test against server release candidate?"
139
server-tag:
1410
required: false
1511
default: "latest"
@@ -48,7 +44,6 @@ runs:
4844
if: ${{ inputs.run-tests == 'true' }}
4945
uses: ./.github/actions/run-ee-server
5046
with:
51-
use-server-rc: ${{ inputs.use-server-rc }}
5247
server-tag: ${{ inputs.server-tag }}
5348
server-type: ${{ inputs.server-type }}
5449
oidc-provider: ${{ inputs.oidc-provider }}

.github/workflows/test-branch-runner.yaml

Lines changed: 57 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,66 @@ on:
99
description: Branch to run test against
1010

1111
jobs:
12+
make-matrix:
13+
runs-on: ${{ vars.BUILD_CONTAINER_DISTRO_VERSION }}
14+
outputs:
15+
input-matrix: ${{ steps.set.outputs.input-matrix }}
16+
java-version: ${{ steps.get-java-version.outputs.java-version }}
17+
steps:
18+
- uses: actions/checkout@v4 # brings versions.json into the workspace
19+
with:
20+
ref: ${{ github.ref }}
21+
22+
- id: set # create the matrix (compact JSON string)
23+
shell: bash
24+
env:
25+
DEFAULT_JSON: ${{ vars.DEFAULT_SERVER_VERSIONS }}
26+
TEST_SERVERS_FILE_PATH: ${{ vars.TEST_SERVERS_FILE_PATH }}
27+
run: |
28+
FILE=${TEST_SERVERS_FILE_PATH}
29+
30+
if [[ -s "$FILE" ]]; then
31+
echo "Using $FILE from repository"
32+
JSON=$(cat "$FILE")
33+
else
34+
echo "$FILE missing or empty – using DEFAULT_SERVER_VERSIONS"
35+
JSON="$DEFAULT_JSON"
36+
fi
37+
38+
MATRIX=$(echo "$JSON" | jq -c '
39+
to_entries
40+
| map({
41+
server: .key,
42+
version: .value.version,
43+
type: .value.type,
44+
})
45+
')
46+
47+
echo input-matrix="$MATRIX" >> $GITHUB_OUTPUT
48+
49+
- name: Get java version
50+
id: get-java-version
51+
run: |
52+
echo java-version="$(grep '<java.version>' pom.xml | sed -e 's/<[^>]*>//g' | awk '{$1=$1};1' | sed 's/^1\.8$/8/')" >> $GITHUB_OUTPUT
53+
54+
- name: debug - print input variables
55+
run: |
56+
echo ${{ steps.get-java-version.outputs.java-version }}
57+
echo ${{ steps.set.outputs.input-matrix }}
58+
1259
build-and-test:
1360
uses: ./.github/workflows/test-branch.yaml
61+
needs: make-matrix
1462
strategy:
15-
matrix:
63+
matrix:
64+
include: ${{ fromJson(needs.make-matrix.outputs.input-matrix) }}
1665
crypto-type: [bouncycastle, gnu]
17-
use-server-rc: [true, false]
18-
fail-fast: false
66+
name: build-${{ matrix.server }}-${{ matrix.version }}
1967
with:
20-
source-branch: ${{ inputs.source-branch }}
68+
java-version: ${{ needs.make-matrix.outputs.java-version }}
2169
crypto-type: ${{ matrix.crypto-type }}
22-
use-server-rc: ${{ matrix.use-server-rc }}
23-
server-tag: latest
24-
secrets: inherit
70+
source-branch: ${{ inputs.source-branch }}
71+
run-tests: true
72+
server-tag: ${{ matrix.version }}
73+
server-type: ${{ matrix.type }}
74+
secrets: inherit

.github/workflows/test-branch.yaml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@ on:
1212
crypto-type:
1313
type: string
1414
required: true
15-
use-server-rc:
16-
type: boolean
15+
java-version:
16+
type: string
1717
required: true
1818
server-tag:
1919
type: string
2020
required: true
21+
server-type:
22+
type: string
23+
required: true
2124
secrets:
2225
JFROG_OIDC_PROVIDER:
2326
required: true
@@ -34,25 +37,20 @@ jobs:
3437
fetch-depth: 0
3538
ref: ${{ inputs.source-branch }}
3639

37-
- name: Get java version
38-
id: get-java-version
39-
run: |
40-
echo java-version="$(grep '<java.version>' pom.xml | sed -e 's/<[^>]*>//g' | awk '{$1=$1};1' | sed 's/^1\.8$/8/')" >> $GITHUB_OUTPUT
41-
4240
# Java plugin will setup gpg but we are not using maven to deploy do JFrog.
4341
# - jf mvn clean install on publish does not publish POM we would like to publish
4442
- name: Setup Java
4543
uses: actions/setup-java@v4
4644
with:
4745
distribution: "semeru"
48-
java-version: ${{ steps.get-java-version.outputs.java-version }}
46+
java-version: ${{ inputs.java-version }}
4947

5048
# Running build followed by tests
5149
- name: Build and test
5250
uses: ./.github/actions/build-and-test
5351
with:
5452
crypto-type: ${{ inputs.crypto-type }}
5553
server-tag: ${{ inputs.server-tag }}
56-
use-server-rc: ${{ inputs.use-server-rc }}
54+
server-type: ${{ inputs.server-type }}
5755
oidc-provider: ${{ secrets.JFROG_OIDC_PROVIDER }}
5856
oidc-audience: ${{ secrets.JFROG_OIDC_AUDIENCE }}

0 commit comments

Comments
 (0)