From bf63d301c0e3d19c9413686da17866907e7651b3 Mon Sep 17 00:00:00 2001 From: Yevhen Hrytsai Date: Wed, 15 May 2024 01:14:22 +0300 Subject: [PATCH] run tests against LTS versions --- .github/workflows/dyn-matrices.yml | 129 ++++++++++++++++++++++---- .github/workflows/matrix-v2.json | 29 ++++++ .github/workflows/prepare-matrices.sh | 11 +-- 3 files changed, 145 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/matrix-v2.json diff --git a/.github/workflows/dyn-matrices.yml b/.github/workflows/dyn-matrices.yml index 26c8b26..f7f0dce 100644 --- a/.github/workflows/dyn-matrices.yml +++ b/.github/workflows/dyn-matrices.yml @@ -7,9 +7,9 @@ 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 }} @@ -17,45 +17,140 @@ jobs: 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/** diff --git a/.github/workflows/matrix-v2.json b/.github/workflows/matrix-v2.json new file mode 100644 index 0000000..7abc693 --- /dev/null +++ b/.github/workflows/matrix-v2.json @@ -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"] + } + } +} \ No newline at end of file diff --git a/.github/workflows/prepare-matrices.sh b/.github/workflows/prepare-matrices.sh index 1304d4a..0ac434e 100755 --- a/.github/workflows/prepare-matrices.sh +++ b/.github/workflows/prepare-matrices.sh @@ -1,8 +1,5 @@ #!/usr/bin/env bash -ls -lah ./ -ls -lah .github/workflows - slack_pl_version=$(cat ./pom.xml | grep -oE -m 1 '[0-9][0-9]?\.[0-9]+\.[0-9]+' | grep -oE '[0-9]\.[0-9]+\.[0-9]+') echo "Slack Plugin Version $slack_pl_version" @@ -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 \ No newline at end of file +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 \ No newline at end of file