Skip to content

Commit

Permalink
Fix workflows and CI scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Yevhen Hrytsai committed Jul 27, 2024
1 parent 39dce56 commit 6bf4faf
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 178 deletions.
43 changes: 17 additions & 26 deletions .github/workflows/all-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,15 @@ jobs:
# check path to bundled Maven executable; it should be then used in ATLAS_MVN
- run: mvn -version

prepare:
name: Prepare Matrix
runs-on: ubuntu-latest
outputs:
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 }}
# TODO: Remove these flags when new major jira (10.x) is released
skip-jira-its: ${{ steps.set-matrix.outputs.skip-jira-its }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
- id: set-matrix
run: bin/build/prepare-matrices.sh

unit-tests:
name: Unit Tests
needs: prepare
runs-on: ubuntu-20.04
# around 800 Mb of dependencies need to be loaded; it may take long first time until it's cached
timeout-minutes: 30
if: "(github.event.inputs.jobs == '' || contains(github.event.inputs.jobs, 'unit-tests')) && !contains(github.event.head_commit.message, '[skip ci]')"
strategy:
matrix: ${{ fromJSON(needs.prepare.outputs.unit-tests-matrix) }}
matrix:
java-version: [17]
fail-fast: false
steps:
- uses: actions/checkout@v4
Expand All @@ -75,10 +58,13 @@ jobs:
name: Jira
runs-on: ubuntu-20.04
timeout-minutes: 30
if: (github.event.inputs.jobs == '' || contains(github.event.inputs.jobs, 'integration-tests-jira')) && !needs.prepare.outputs.skip-jira-its
needs: [prepare, unit-tests]
# Disabled until Jira version is available
if: (github.event.inputs.jobs == '' || contains(github.event.inputs.jobs, 'integration-tests-jira')) && false
needs: unit-tests
strategy:
matrix: ${{ fromJSON(needs.prepare.outputs.jira-it-matrix) }}
matrix:
java-version: [17]
jira-version: [10.0.0]
fail-fast: false
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -112,9 +98,12 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 30
if: github.event.inputs.jobs == '' || contains(github.event.inputs.jobs, 'integration-tests-confluence')
needs: [prepare, unit-tests]
needs: unit-tests
strategy:
matrix: ${{ fromJSON(needs.prepare.outputs.confluence-it-matrix) }}
matrix:
# every version part should be 0 <= <version> <= 255; otherwise Confluence fails to start
java-version: [17]
confluence-version: [9.0.0-m72]
fail-fast: false
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -148,9 +137,11 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 30
if: github.event.inputs.jobs == '' || contains(github.event.inputs.jobs, 'integration-tests-bitbucket')
needs: [prepare, unit-tests]
needs: unit-tests
strategy:
matrix: ${{ fromJSON(needs.prepare.outputs.bitbucket-it-matrix) }}
matrix:
java-version: [17]
bitbucket-version: [9.0.0-eap03]
fail-fast: false
steps:
- uses: actions/checkout@v4
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/bitbucket-int-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,34 @@ jobs:
timeout-minutes: 30
steps:
- run: echo 'Github event inputs [${{ toJson(github.event.inputs) }}].'
- uses: actions/checkout@v3
- 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@v3
- uses: actions/setup-java@v4
with:
java-version: ${{ github.event.inputs.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@v3
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: maven-unit
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ~/.m2/repository/com/atlassian/bitbucket
key: maven-integration-bitbucket-${{ github.event.inputs.product-version }}
- run: bin/build/install-common-modules.sh
- run: |
VERSION=${{ github.event.inputs.product-version }} \
bin/build/run-bitbucket-its.sh
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: failure()
with:
name: webdriver-screenshots-bitbucket-${{ github.event.inputs.product-version }}-java-${{ github.event.inputs.java-version }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/confluence-int-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,29 @@ jobs:
timeout-minutes: 30
steps:
- run: echo 'Github event inputs [${{ toJson(github.event.inputs) }}].'
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
java-version: ${{ github.event.inputs.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@v3
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: maven-unit
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ~/.m2/repository/com/atlassian/confluence
key: maven-integration-confluence-${{ github.event.inputs.product-version }}
- run: bin/build/install-common-modules.sh
- run: |
VERSION=${{ github.event.inputs.product-version }} \
bin/build/run-confluence-its.sh
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: failure()
with:
name: webdriver-screenshots-confluence-${{ github.event.inputs.product-version }}-java-${{ github.event.inputs.java-version }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/jira-int-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@ jobs:
timeout-minutes: 30
steps:
- run: echo 'Github event inputs [${{ toJson(github.event.inputs) }}].'
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
java-version: ${{ github.event.inputs.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@v3
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: maven-unit
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ~/.m2/repository/com/atlassian/jira
key: maven-integration-jira-${{ github.event.inputs.product-version }}
Expand All @@ -46,7 +46,7 @@ jobs:
VERSION=${{ github.event.inputs.product-version }} \
TESTKIT_VERSION=${{ github.event.inputs.testkit-version }} \
bin/build/run-jira-its.sh
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: failure()
with:
name: webdriver-screenshots-jira-${{ github.event.inputs.product-version }}-java-${{ github.event.inputs.java-version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
echo 'Release version [${{ github.event.inputs.release-version }}].'
echo 'Next development version [${{ github.event.inputs.next-development-version }}].'
- name: Check out the code from selected branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
- name: Configure git for operations performed during the release
Expand All @@ -55,7 +55,7 @@ jobs:
run: bin/build/install-plugin-sdk.sh
- run: bin/build/override-plugin-sdk-maven.sh
- name: Unpack cached Maven dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: maven-release
Expand Down
30 changes: 0 additions & 30 deletions bin/build/get-plugin-major-version.sh

This file was deleted.

58 changes: 0 additions & 58 deletions bin/build/java-product-matrix.json

This file was deleted.

31 changes: 3 additions & 28 deletions bin/release-check/check-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,37 +47,12 @@ esac
echo "Determined workflow name: $workflow_name"

# RUN TESTS AGAINST SPECIFIC VERSIONS
workflow_links=()
pl_common_version=$(. ../build/get-plugin-major-version.sh common)
if [ $pl_common_version -eq 1 ]; then
if [ $product_type != "confluence" ]; then
echo "Running workflow with params: workflow-name=$workflow_name java-version=8.0.252 product-version=$product_version"
first_workflow_link=$(start_workflow $workflow_name 8.0.252 $product_version)
echo "Pipeline URL: $first_workflow_link"
workflow_links+=("$first_workflow_link")
fi

echo "Running workflow with params: workflow-name=$workflow_name java-version=11 product-version=$product_version"
second_workflow_link=$(start_workflow $workflow_name 11 $product_version)
echo "Pipeline URL: $second_workflow_link"
workflow_links+=("$second_workflow_link")
fi

echo "Running workflow with params: workflow-name=$workflow_name java-version=17 product-version=$product_version"
third_workflow_link=$(start_workflow $workflow_name 17 $product_version)
echo "Pipeline URL: $third_workflow_link"
workflow_links+=("$third_workflow_link")

# Join elements with a multi-character delimiter
function join_by {
local d=${1-} f=${2-}
if shift 2; then
printf %s "$f" "${@/#/$d}"
fi
}
workflow_link=$(start_workflow $workflow_name 17 $product_version)
echo "Pipeline URL: $workflow_link"

# CREATE NEW ISSUE FOR RELEASE
echo "Creating a new issue"
new_issue_url=$(RELEASE_LABEL="$release_label" WORKFLOW_LINKS="$(join_by ', ' ${workflow_links[@]})" . ./create-issue.sh)
new_issue_url=$(RELEASE_LABEL="$release_label" WORKFLOW_LINKS="$workflow_link" . ./create-issue.sh)

echo "New ticket created: $new_issue_url"
14 changes: 0 additions & 14 deletions bin/release-check/plugin-product-compat-matrix.json

This file was deleted.

20 changes: 15 additions & 5 deletions bin/release-check/run-product-release-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,25 @@ if [ "$latest_releases" = "" ]; then
exit
fi

# TAKE AND CHECKS LATEST COMPATIBLE VERSION ONLY, MEANING THE GREATEST REVISION VERSION
pl_product_version=$(. ../get-plugin-major-version.sh "$PRODUCT")
product_compat_version_regex=$(jq -r --arg pl "$pl_product_version" --arg p "$PRODUCT" '.[$p].[$pl]' ./plugin-product-compat-matrix.json)
latest_version=$(echo "$latest_releases" | grep -oE "$product_compat_version_regex" | tail -1)
case $PRODUCT in
jira)
version_regex="10\\.[0-9]+\\.[0-9]+"
;;
confluence|bitbucket)
version_regex="9\\.[0-9]+\\.[0-9]+"
;;
*)
echo "Invalid product"
exit 1
;;
esac

latest_version=$(echo "$latest_releases" | grep -oE "$version_regex" | tail -1)

if [ "$latest_version" = "" ]; then
echo "Could not find latest versions"
echo "Product [$PRODUCT]"
echo "Compatible version pattern [$product_compat_version_regex]"
echo "Compatible version pattern [$version_regex]"
exit
fi

Expand Down

0 comments on commit 6bf4faf

Please sign in to comment.