Skip to content

Commit

Permalink
run tests against LTS versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Yevhen Hrytsai committed May 14, 2024
1 parent d053d63 commit bf63d30
Show file tree
Hide file tree
Showing 3 changed files with 145 additions and 24 deletions.
129 changes: 112 additions & 17 deletions .github/workflows/dyn-matrices.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,55 +7,150 @@ on:

jobs:
prepare:
runs-on: ubuntu-20.04
name: Prepare Matrix
runs-on: ubuntu-latest
outputs:
# matrix: ${{ steps.set-matrix.outputs.matrix }}
unit-tests-matrix: ${{ steps.set-matrix.outputs.unit-tests-matrix }}
jira-it-matrix: ${{ steps.set-matrix.outputs.jira-it-matrix }}
confluence-it-matrix: ${{ steps.set-matrix.outputs.confluence-it-matrix }}
bitbucket-it-matrix: ${{ steps.set-matrix.outputs.bitbucket-it-matrix }}
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
pom.xml
.github/workflows/matrix.json
.github/workflows/prepare-matrices.sh
ref: ${{ github.event.inputs.ref }}
- id: set-matrix
run: .github/workflows/prepare-matrices.sh

run-tests:
name: Unit Tests
needs: prepare
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJSON(needs.prepare.outputs.unit-tests-matrix) }}
fail-fast: false
steps:
- run: echo "Matrix - Java ${{ matrix.java-version }}"
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: adopt
- run: bin/build/install-plugin-sdk.sh
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: maven-unit
- run: bin/build/override-plugin-sdk-maven.sh
- run: bin/build/run-unit-tests.sh
- uses: actions/upload-artifact@v4
with:
name: unit-tests-coverage-java-${{ matrix.java-version }}
path: '**/target/site/jacoco/**'

integration-tests-jira:
needs: prepare
runs-on: ubuntu-20.04
name: Jira
needs: [prepare, run-tests]
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJSON(needs.prepare.outputs.jira-it-matrix) }}
fail-fast: false
steps:
- run: echo "Matrix - Java ${{ matrix.java-version }} Jira ${{ matrix.jira-version }}"
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: adopt
- run: bin/build/install-plugin-sdk.sh
- run: bin/build/override-plugin-sdk-maven.sh
- run: bin/build/install-int-test-libs.sh
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: maven-unit
- uses: actions/cache@v4
with:
path: ~/.m2/repository/com/atlassian/jira
key: maven-integration-jira-${{ matrix.jira-version }}
- run: bin/build/install-common-modules.sh
- run: VERSION=${{ matrix.jira-version }} bin/build/run-jira-its.sh
- uses: actions/upload-artifact@v4
if: failure()
with:
name: webdriver-screenshots-jira-${{ matrix.jira-version }}
path: jira-slack-server-integration/jira-slack-server-integration-plugin/target/webdriverTests/**

integration-tests-confluence:
needs: prepare
runs-on: ubuntu-20.04
name: Confluence
needs: [prepare, run-tests]
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJSON(needs.prepare.outputs.confluence-it-matrix) }}
fail-fast: false
steps:
- run: echo "Matrix - Java ${{ matrix.java-version }} Confluence ${{ matrix.confluence-version }}"
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: adopt
- run: bin/build/install-plugin-sdk.sh
- run: bin/build/override-plugin-sdk-maven.sh
- run: bin/build/install-int-test-libs.sh
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: maven-unit
- uses: actions/cache@v4
with:
path: ~/.m2/repository/com/atlassian/confluence
key: maven-integration-confluence-${{ matrix.confluence-version }}
- run: bin/build/install-common-modules.sh
- run: VERSION=${{ matrix.confluence-version }} bin/build/run-confluence-its.sh
- uses: actions/upload-artifact@v4
if: failure()
with:
name: webdriver-screenshots-confluence-${{ matrix.confluence-version }}-java-${{ matrix.java-version }}
path: confluence-slack-server-integration-plugin/target/webdriverTests/**

integration-tests-bitbucket:
needs: prepare
runs-on: ubuntu-20.04
name: Bitbucket
needs: [prepare, run-tests]
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJSON(needs.prepare.outputs.bitbucket-it-matrix) }}
fail-fast: false
steps:
- run: echo "Matrix - Java ${{ matrix.java-version }} Bitbucket ${{ matrix.bitbucket-version }}"
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
# Dec 13, 2022
# latest Bitbucket 8.6.1 doesn't support latest git 2.38.1 installed on the Ubuntu 20 image Github provides
# install last supported git - 2.37.4; remove this trick once Bitbucket implements support for latest git
# https://confluence.atlassian.com/bitbucketserver/supported-platforms-776640981.html#Supportedplatforms-dvcsDVCS
- run: bin/build/install-supported-git.sh
- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: adopt
- run: bin/build/install-plugin-sdk.sh
- run: bin/build/override-plugin-sdk-maven.sh
- run: bin/build/install-int-test-libs.sh
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: maven-unit
- uses: actions/cache@v4
with:
path: ~/.m2/repository/com/atlassian/bitbucket
key: maven-integration-bitbucket-${{ matrix.bitbucket-version }}
- run: bin/build/install-common-modules.sh
- run: VERSION=${{ matrix.bitbucket-version }} bin/build/run-bitbucket-its.sh
- uses: actions/upload-artifact@v4
if: failure()
with:
name: webdriver-screenshots-bitbucket-${{ matrix.bitbucket-version }}-java-${{ matrix.java-version }}
path: bitbucket-slack-server-integration-plugin/target/webdriverTests/**
29 changes: 29 additions & 0 deletions .github/workflows/matrix-v2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"old": {
"unit-tests": {
"java-version": ["8", "11"]
},
"jira-it": {
"java-version": ["8", "11", "17"],
"jira-version": ["9.4.0", "9.12.0"]
},
"confluence-it": {
"java-version": ["8", "11", "17"],
"confluence-version": ["7.19.0", "8.5.0"],
"exclude": [
{
"java-version": "8",
"confluence-version": "8.5.0"
},
{
"java-version": "17",
"confluence-version": "7.19.0"
}
]
},
"bitbucket-it": {
"java-version": ["8", "11", "17"],
"bitbucket-version": ["8.9.0", "8.19.0"]
}
}
}
11 changes: 4 additions & 7 deletions .github/workflows/prepare-matrices.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/usr/bin/env bash

ls -lah ./
ls -lah .github/workflows

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]+')
echo "Slack Plugin Version $slack_pl_version"

Expand All @@ -14,7 +11,7 @@ else
fi
echo "Matrix key - $matrix_key"

echo "unit-tests-matrix=$(jq --compact-output --arg v "$matrix_key" '.[$v]."unit-tests"' .github/workflows/matrix.json)" >> $GITHUB_OUTPUT
echo "jira-it-matrix=$(jq --compact-output --arg v "$matrix_key" '.[$v]."jira-it"' .github/workflows/matrix.json)" >> $GITHUB_OUTPUT
echo "confluence-it-matrix=$(jq --compact-output --arg v "$matrix_key" '.[$v]."confluence-it"' .github/workflows/matrix.json)" >> $GITHUB_OUTPUT
echo "bitbucket-it-matrix=$(jq --compact-output --arg v "$matrix_key" '.[$v]."bitbucket-it"' .github/workflows/matrix.json)" >> $GITHUB_OUTPUT
echo "unit-tests-matrix=$(jq --compact-output --arg v "$matrix_key" '.[$v]."unit-tests"' .github/workflows/matrix-v2.json)" >> $GITHUB_OUTPUT
echo "jira-it-matrix=$(jq --compact-output --arg v "$matrix_key" '.[$v]."jira-it"' .github/workflows/matrix-v2.json)" >> $GITHUB_OUTPUT
echo "confluence-it-matrix=$(jq --compact-output --arg v "$matrix_key" '.[$v]."confluence-it"' .github/workflows/matrix-v2.json)" >> $GITHUB_OUTPUT
echo "bitbucket-it-matrix=$(jq --compact-output --arg v "$matrix_key" '.[$v]."bitbucket-it"' .github/workflows/matrix-v2.json)" >> $GITHUB_OUTPUT

0 comments on commit bf63d30

Please sign in to comment.