Skip to content

Commit d053d63

Browse files
committed
test dynamic matrices
1 parent 34ed213 commit d053d63

File tree

2 files changed

+22
-19
lines changed

2 files changed

+22
-19
lines changed

.github/workflows/dyn-matrices.yml

+2-19
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,9 @@ jobs:
2020
sparse-checkout: |
2121
pom.xml
2222
.github/workflows/matrix.json
23-
sparse-checkout-cone-mode: true
23+
.github/workflows/prepare-matrices.sh
2424
- id: set-matrix
25-
run: |
26-
ls -lah ./
27-
28-
slack_pl_version=$(cat ./pom.xml | grep -oE -m 1 '<version>[0-9][0-9]?\.[0-9]+\.[0-9]+</version>' | grep -oE '[0-9]\.[0-9]+\.[0-9]+')
29-
echo "Slack Plugin Version $slack_pl_version"
30-
31-
if [ ${slack_pl_version%.*.*} -gt 1 ]; then
32-
pl_version='current'
33-
else
34-
pl_version='old'
35-
fi
36-
echo "Matrix key - $pl_version"
37-
38-
echo "unit-tests-matrix=$(jq --compact-output --arg v "$pl_version" '.[$v]."unit-tests"' .github/workflows/matrix.json)" >> $GITHUB_OUTPUT
39-
echo "jira-it-matrix=$(jq --compact-output --arg v "$pl_version" '.[$v]."jira-it"' .github/workflows/matrix.json)" >> $GITHUB_OUTPUT
40-
echo "confluence-it-matrix=$(jq --compact-output --arg v "$pl_version" '.[$v]."confluence-it"' .github/workflows/matrix.json)" >> $GITHUB_OUTPUT
41-
echo "bitbucket-it-matrix=$(jq --compact-output --arg v "$pl_version" '.[$v]."bitbucket-it"' .github/workflows/matrix.json)" >> $GITHUB_OUTPUT
42-
# echo "matrix={\"java-version\":[\"8\",\"11\",\"17\"],\"bitbucket-version\":[\"7.6.0\",\"8.8.0\"],\"exclude\":[{\"java-version\":\"17\",\"bitbucket-version\":\"7.6.0\"}]}" >> $GITHUB_OUTPUT
25+
run: .github/workflows/prepare-matrices.sh
4326

4427
run-tests:
4528
needs: prepare

.github/workflows/prepare-matrices.sh

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
3+
ls -lah ./
4+
ls -lah .github/workflows
5+
6+
slack_pl_version=$(cat ./pom.xml | grep -oE -m 1 '<version>[0-9][0-9]?\.[0-9]+\.[0-9]+</version>' | grep -oE '[0-9]\.[0-9]+\.[0-9]+')
7+
echo "Slack Plugin Version $slack_pl_version"
8+
9+
# Get slack plugin major version
10+
if [ ${slack_pl_version%.*.*} -gt 1 ]; then
11+
matrix_key='current'
12+
else
13+
matrix_key='old'
14+
fi
15+
echo "Matrix key - $matrix_key"
16+
17+
echo "unit-tests-matrix=$(jq --compact-output --arg v "$matrix_key" '.[$v]."unit-tests"' .github/workflows/matrix.json)" >> $GITHUB_OUTPUT
18+
echo "jira-it-matrix=$(jq --compact-output --arg v "$matrix_key" '.[$v]."jira-it"' .github/workflows/matrix.json)" >> $GITHUB_OUTPUT
19+
echo "confluence-it-matrix=$(jq --compact-output --arg v "$matrix_key" '.[$v]."confluence-it"' .github/workflows/matrix.json)" >> $GITHUB_OUTPUT
20+
echo "bitbucket-it-matrix=$(jq --compact-output --arg v "$matrix_key" '.[$v]."bitbucket-it"' .github/workflows/matrix.json)" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)