ACS-3841 Use custom actions to setup build tools [db][tas][db][ags][ags on MySQL]

This commit is contained in:
Damian.Ujma@hyland.com
2022-11-25 13:08:32 +01:00
parent 50b7d83495
commit 18acbf65dc
2 changed files with 102 additions and 247 deletions

View File

@@ -12,6 +12,7 @@ on:
env: env:
DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }}
CACHE_CLEANUP_SCRIPT: ./scripts/ci/cleanup_cache.sh
GITHUB_ACTIONS_DEPLOY_TIMEOUT: 60 GITHUB_ACTIONS_DEPLOY_TIMEOUT: 60
JAVA_VERSION: "17" JAVA_VERSION: "17"
LOG_WARN: "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn" LOG_WARN: "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
@@ -23,23 +24,24 @@ env:
TAS_SCRIPTS: ../alfresco-community-repo/packaging/tests/scripts TAS_SCRIPTS: ../alfresco-community-repo/packaging/tests/scripts
jobs: jobs:
configure_env:
name: Configure build env vars
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: Alfresco/alfresco-build-tools/.github/actions/get-branch-name@v1.23.0
- uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/get-build-info
prepare: prepare:
name: "Prepare" name: "Prepare"
needs: configure_env
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: > if: >
! contains(github.event.head_commit.message, '[skip tests]') && ! contains(github.event.head_commit.message, '[skip tests]') &&
! contains(github.event.head_commit.message, '[force]') ! contains(github.event.head_commit.message, '[force]')
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Cache local Maven repository - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: "Clean cache"
run: bash ./scripts/ci/cleanup_cache.sh
- name: "Prepare environment" - name: "Prepare environment"
run: bash ./scripts/ci/prepare.sh run: bash ./scripts/ci/prepare.sh
@@ -65,8 +67,10 @@ jobs:
- uses: Alfresco/alfresco-build-tools/.github/actions/veracode@master - uses: Alfresco/alfresco-build-tools/.github/actions/veracode@master
with: with:
srcclr-api-token: ${{ secrets.SRCCLR_API_TOKEN }} srcclr-api-token: ${{ secrets.SRCCLR_API_TOKEN }}
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
AllUnitTestsSuite: all_unit_tests_suite:
name: "Core, Data-Model, Repository - AllUnitTestsSuite - Build and test" name: "Core, Data-Model, Repository - AllUnitTestsSuite - Build and test"
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
@@ -77,24 +81,15 @@ jobs:
! contains(github.event.head_commit.message, '[force]') ! contains(github.event.head_commit.message, '[force]')
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Cache local Maven repository - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: "Set up Java"
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: "temurin"
- name: "Run tests" - name: "Run tests"
run: | run: |
mvn -B test -pl core,data-model -am -DfailIfNoTests=false mvn -B test -pl core,data-model -am -DfailIfNoTests=false
mvn -B test -pl "repository,mmt" -am "-Dtest=AllUnitTestsSuite,AllMmtUnitTestSuite" -DfailIfNoTests=false mvn -B test -pl "repository,mmt" -am "-Dtest=AllUnitTestsSuite,AllMmtUnitTestSuite" -DfailIfNoTests=false
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
Remote-api-AppContextTestSuites: remote_api_app_context_test_suites:
name: Remote-api - ${{ matrix.testSuite }} name: Remote-api - ${{ matrix.testSuite }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
@@ -108,31 +103,21 @@ jobs:
matrix: matrix:
include: include:
- testSuite: AppContext01TestSuite - testSuite: AppContext01TestSuite
profile: default compose-profile: default
- testSuite: AppContext02TestSuite - testSuite: AppContext02TestSuite
profile: with-transform-core-aio compose-profile: with-transform-core-aio
- testSuite: AppContext03TestSuite - testSuite: AppContext03TestSuite
profile: with-transform-core-aio compose-profile: with-transform-core-aio
- testSuite: AppContext04TestSuite - testSuite: AppContext04TestSuite
profile: with-transform-core-aio compose-profile: with-transform-core-aio
- testSuite: AppContextExtraTestSuite - testSuite: AppContextExtraTestSuite
profile: default compose-profile: default
env: env:
REQUIRES_INSTALLED_ARTIFACTS: true REQUIRES_INSTALLED_ARTIFACTS: true
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Cache local Maven repository - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: "Set up Java"
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: "temurin"
- name: "Build" - name: "Build"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: | run: |
@@ -141,11 +126,13 @@ jobs:
- name: "Set transformers tag" - name: "Set transformers tag"
run: echo "TRANSFORMERS_TAG=$(mvn help:evaluate -Dexpression=dependency.alfresco-transform-core.version -q -DforceStdout)" >> $GITHUB_ENV run: echo "TRANSFORMERS_TAG=$(mvn help:evaluate -Dexpression=dependency.alfresco-transform-core.version -q -DforceStdout)" >> $GITHUB_ENV
- name: "Set up the environment" - name: "Set up the environment"
run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile ${{ matrix.profile }} up -d run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile ${{ matrix.compose-profile }} up -d
- name: "Run tests" - name: "Run tests"
run: mvn -B test -pl remote-api -Dtest=${{ matrix.testSuite }} -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco run: mvn -B test -pl remote-api -Dtest=${{ matrix.testSuite }} -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
Repository-MariaDB-tests: repository_mariadb_tests:
name: Repository - MariaDB ${{ matrix.version }} tests name: Repository - MariaDB ${{ matrix.version }} tests
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
@@ -162,26 +149,17 @@ jobs:
version: ['10.2.18', '10.4', '10.5'] version: ['10.2.18', '10.4', '10.5']
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Cache local Maven repository - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: "Set up Java"
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: "temurin"
- name: "Set up the environment" - name: "Set up the environment"
run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile mariadb up -d run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile mariadb up -d
env: env:
MARIADB_VERSION: ${{ matrix.version }} MARIADB_VERSION: ${{ matrix.version }}
- name: "Run tests" - name: "Run tests"
run: mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -DfailIfNoTests=false -Ddb.name=alfresco -Ddb.url=jdbc:mariadb://localhost:3307/alfresco?useUnicode=yes\&characterEncoding=UTF-8 -Ddb.username=alfresco -Ddb.password=alfresco -Ddb.driver=org.mariadb.jdbc.Driver run: mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -DfailIfNoTests=false -Ddb.name=alfresco -Ddb.url=jdbc:mariadb://localhost:3307/alfresco?useUnicode=yes\&characterEncoding=UTF-8 -Ddb.username=alfresco -Ddb.password=alfresco -Ddb.driver=org.mariadb.jdbc.Driver
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
Repository-MariaDB10-6-tests: repository_mariadb_10_6_tests:
name: "Repository - MariaDB 10.6 tests" name: "Repository - MariaDB 10.6 tests"
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
@@ -195,26 +173,17 @@ jobs:
! contains(github.event.head_commit.message, '[force]') ! contains(github.event.head_commit.message, '[force]')
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Cache local Maven repository - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: "Set up Java"
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: "temurin"
- name: "Set up the environment" - name: "Set up the environment"
run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile mariadb up -d run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile mariadb up -d
env: env:
MARIADB_VERSION: 10.6 MARIADB_VERSION: 10.6
- name: "Run tests" - name: "Run tests"
run: mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -DfailIfNoTests=false -Ddb.name=alfresco -Ddb.url=jdbc:mariadb://localhost:3307/alfresco?useUnicode=yes\&characterEncoding=UTF-8 -Ddb.username=alfresco -Ddb.password=alfresco -Ddb.driver=org.mariadb.jdbc.Driver run: mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -DfailIfNoTests=false -Ddb.name=alfresco -Ddb.url=jdbc:mariadb://localhost:3307/alfresco?useUnicode=yes\&characterEncoding=UTF-8 -Ddb.username=alfresco -Ddb.password=alfresco -Ddb.driver=org.mariadb.jdbc.Driver
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
Repository-MySQL-tests: repository_mysql_tests:
name: Repository - MySQL 8 tests name: Repository - MySQL 8 tests
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
@@ -228,26 +197,17 @@ jobs:
! contains(github.event.head_commit.message, '[force]') ! contains(github.event.head_commit.message, '[force]')
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Cache local Maven repository - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: "Set up Java"
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: "temurin"
- name: "Set up the environment" - name: "Set up the environment"
run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile mysql up -d run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile mysql up -d
env: env:
MYSQL_VERSION: 8 MYSQL_VERSION: 8
- name: "Run tests" - name: "Run tests"
run: mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -DfailIfNoTests=false -Ddb.driver=com.mysql.jdbc.Driver -Ddb.name=alfresco -Ddb.url=jdbc:mysql://localhost:3307/alfresco -Ddb.username=alfresco -Ddb.password=alfresco run: mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -DfailIfNoTests=false -Ddb.driver=com.mysql.jdbc.Driver -Ddb.name=alfresco -Ddb.url=jdbc:mysql://localhost:3307/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
Repository-PostgreSQL13-7-tests: repository_postgresql_13_7_tests:
name: "Repository - PostgreSQL 13.7 tests" name: "Repository - PostgreSQL 13.7 tests"
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
@@ -260,26 +220,17 @@ jobs:
! contains(github.event.head_commit.message, '[force]') ! contains(github.event.head_commit.message, '[force]')
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Cache local Maven repository - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: "Set up Java"
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: "temurin"
- name: "Set up the environment" - name: "Set up the environment"
run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile postgres up -d run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile postgres up -d
env: env:
POSTGRES_VERSION: 10.6 POSTGRES_VERSION: 10.6
- name: "Run tests" - name: "Run tests"
run: mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco run: mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
Repository-PostgreSQL14-4-tests: repository_postgresql_14_4_tests:
name: "Repository - PostgreSQL 14.4 tests" name: "Repository - PostgreSQL 14.4 tests"
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
@@ -293,26 +244,17 @@ jobs:
! contains(github.event.head_commit.message, '[force]') ! contains(github.event.head_commit.message, '[force]')
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Cache local Maven repository - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: "Set up Java"
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: "temurin"
- name: "Set up the environment" - name: "Set up the environment"
run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile postgres up -d run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile postgres up -d
env: env:
POSTGRES_VERSION: 14.4 POSTGRES_VERSION: 14.4
- name: "Run tests" - name: "Run tests"
run: mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco run: mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
Repository-Messaging-tests: repository_messaging_tests:
name: Repository - Messaging tests name: Repository - Messaging tests
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
@@ -324,23 +266,15 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Cache local Maven repository - name: Cache local Maven repository
uses: actions/cache@v2 - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: "Set up Java"
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: "temurin"
- name: "Set up the environment" - name: "Set up the environment"
run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile activemq up -d run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile activemq up -d
- name: "Run tests" - name: "Run tests"
run: mvn -B test -pl repository -am -Dtest=CamelRoutesTest,CamelComponentsTest -DfailIfNoTests=false run: mvn -B test -pl repository -am -Dtest=CamelRoutesTest,CamelComponentsTest -DfailIfNoTests=false
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
Repository-AppContextTestSuites: repository_app_context_test_suites:
name: Repository - ${{ matrix.testSuite }} name: Repository - ${{ matrix.testSuite }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
@@ -354,39 +288,28 @@ jobs:
matrix: matrix:
include: include:
- testSuite: AppContext01TestSuite - testSuite: AppContext01TestSuite
profile: with-transform-core-aio compose-profile: with-transform-core-aio
- testSuite: AppContext02TestSuite - testSuite: AppContext02TestSuite
profile: default compose-profile: default
- testSuite: AppContext03TestSuite - testSuite: AppContext03TestSuite
profile: with-transform-core-aio compose-profile: with-transform-core-aio
- testSuite: AppContext04TestSuite - testSuite: AppContext04TestSuite
profile: with-transform-core-aio compose-profile: with-transform-core-aio
- testSuite: AppContext05TestSuite - testSuite: AppContext05TestSuite
profile: default compose-profile: default
parameters: '"-Didentity-service.auth-server-url=http://${HOST_IP}:8999/auth"' parameters: '"-Didentity-service.auth-server-url=http://${HOST_IP}:8999/auth"'
- testSuite: AppContext06TestSuite - testSuite: AppContext06TestSuite
profile: with-transform-core-aio compose-profile: with-transform-core-aio
- testSuite: AppContextExtraTestSuite - testSuite: AppContextExtraTestSuite
profile: with-transform-core-aio compose-profile: with-transform-core-aio
- testSuite: MiscContextTestSuite - testSuite: MiscContextTestSuite
profile: with-transform-core-aio compose-profile: with-transform-core-aio
- testSuite: SearchTestSuite - testSuite: SearchTestSuite
profile: default compose-profile: default
parameters: '-Dindex.subsystem.name=solr6' parameters: '-Dindex.subsystem.name=solr6'
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Cache local Maven repository - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: "Set up Java"
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: "temurin"
- name: "Set up IDS" - name: "Set up IDS"
run: | run: |
if [ "${{ matrix.testSuite }}" == 'AppContext05TestSuite' ]; if [ "${{ matrix.testSuite }}" == 'AppContext05TestSuite' ];
@@ -399,11 +322,13 @@ jobs:
- name: "Set transformers tag" - name: "Set transformers tag"
run: echo "TRANSFORMERS_TAG=$(mvn help:evaluate -Dexpression=dependency.alfresco-transform-core.version -q -DforceStdout)" >> $GITHUB_ENV run: echo "TRANSFORMERS_TAG=$(mvn help:evaluate -Dexpression=dependency.alfresco-transform-core.version -q -DforceStdout)" >> $GITHUB_ENV
- name: "Set up the environment" - name: "Set up the environment"
run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile ${{ matrix.profile }} up -d run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile ${{ matrix.compose-profile }} up -d
- name: "Run tests" - name: "Run tests"
run: mvn -B test -pl repository -am -Dtest=${{ matrix.testSuite }} -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco ${{ matrix.parameters }} run: mvn -B test -pl repository -am -Dtest=${{ matrix.testSuite }} -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco ${{ matrix.parameters }}
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
TAS-Tests: tas-tests:
name: ${{ matrix.test-name }} name: ${{ matrix.test-name }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
@@ -446,18 +371,7 @@ jobs:
REQUIRES_LOCAL_IMAGES: true REQUIRES_LOCAL_IMAGES: true
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Cache local Maven repository - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: "Set up Java"
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: "temurin"
- name: "Build" - name: "Build"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: | run: |
@@ -476,8 +390,10 @@ jobs:
- name: "Run tests" - name: "Run tests"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: mvn -B verify -f packaging/tests/${{ matrix.test-dir }}/pom.xml -Pall-tas-tests,${{ matrix.test-profile }} -Denvironment=default -DrunBugs=false run: mvn -B verify -f packaging/tests/${{ matrix.test-dir }}/pom.xml -Pall-tas-tests,${{ matrix.test-profile }} -Denvironment=default -DrunBugs=false
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
Share-Services-ShareServicesTestSuite: share_services_share_services_test_suite:
name: Share Services - ShareServicesTestSuite name: Share Services - ShareServicesTestSuite
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
@@ -488,24 +404,15 @@ jobs:
! contains(github.event.head_commit.message, '[force]') ! contains(github.event.head_commit.message, '[force]')
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Cache local Maven repository - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: "Set up Java"
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: "temurin"
- name: "Set up the environment" - name: "Set up the environment"
run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile postgres up -d run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile postgres up -d
- name: "Run tests" - name: "Run tests"
run: mvn -B test -pl :alfresco-share-services -am -Dtest=ShareServicesTestSuite -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco run: mvn -B test -pl :alfresco-share-services -am -Dtest=ShareServicesTestSuite -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
AGS-Tests-PostgresSQL: ags_tests_postgressql:
name: AGS Unit & Integration Tests 0${{ matrix.part }} (PostgreSQL) ${{ matrix.test-name }} name: AGS Unit & Integration Tests 0${{ matrix.part }} (PostgreSQL) ${{ matrix.test-name }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
@@ -524,18 +431,7 @@ jobs:
REQUIRES_INSTALLED_ARTIFACTS: true REQUIRES_INSTALLED_ARTIFACTS: true
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Cache local Maven repository - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: "Set up Java"
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: "temurin"
- name: "Build" - name: "Build"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: | run: |
@@ -544,8 +440,10 @@ jobs:
- name: "Verify" - name: "Verify"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: mvn --file amps/ags/pom.xml -B verify -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -Pags -Pstart-postgres -PagsAllTestSuitePt${{ matrix.part }} ${{ env.LOG_WARN }} run: mvn --file amps/ags/pom.xml -B verify -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -Pags -Pstart-postgres -PagsAllTestSuitePt${{ matrix.part }} ${{ env.LOG_WARN }}
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
AGS-Tests-MySQL: ags_tests_mysql:
name: AGS Unit & Integration Tests 0${{ matrix.part }} (PostgreSQL) ${{ matrix.test-name }} name: AGS Unit & Integration Tests 0${{ matrix.part }} (PostgreSQL) ${{ matrix.test-name }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
@@ -564,18 +462,7 @@ jobs:
REQUIRES_INSTALLED_ARTIFACTS: true REQUIRES_INSTALLED_ARTIFACTS: true
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Cache local Maven repository - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: "Set up Java"
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: "temurin"
- name: "Build" - name: "Build"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: | run: |
@@ -584,8 +471,10 @@ jobs:
- name: "Verify" - name: "Verify"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: mvn --file amps/ags/pom.xml -B verify -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -Pags -Pstart-mysql -PagsAllTestSuitePt${{ matrix.part }} ${{ env.LOG_WARN }} run: mvn --file amps/ags/pom.xml -B verify -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -Pags -Pstart-mysql -PagsAllTestSuitePt${{ matrix.part }} ${{ env.LOG_WARN }}
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh
AGS-Community-Rest-API-Tests: ags_community_rest_api_tests:
name: "AGS Community Rest API Tests" name: "AGS Community Rest API Tests"
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
@@ -600,23 +489,7 @@ jobs:
REQUIRES_LOCAL_IMAGES: true REQUIRES_LOCAL_IMAGES: true
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Cache local Maven repository - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: "Login to Docker Hub"
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: "Set up Java"
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: "temurin"
- name: "Build" - name: "Build"
timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }}
run: | run: |
@@ -648,3 +521,5 @@ jobs:
- name: "Upload artifacts to Amazon S3 bucket" - name: "Upload artifacts to Amazon S3 bucket"
if: ${{ always() }} if: ${{ always() }}
run: aws s3 cp --recursive ./deploy_dir s3://ags-travis-artifacts run: aws s3 cp --recursive ./deploy_dir s3://ags-travis-artifacts
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh

View File

@@ -10,38 +10,21 @@ on:
- release/** - release/**
jobs: jobs:
Run-CI: run_ci:
uses: ./.github/workflows/ci.yml uses: ./.github/workflows/ci.yml
secrets: inherit secrets: inherit
Push-to-Nexus: push_to_nexus:
name: "Push to Nexus" name: "Push to Nexus"
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
- Run-CI - run_ci
if: | if: |
always() && always() &&
(needs.Run-CI.result == 'skipped' || needs.Run-CI.result == 'success') && (needs.run_ci.result == 'skipped' || needs.run_ci.result == 'success') &&
! contains(github.event.head_commit.message, '[no release]') ! contains(github.event.head_commit.message, '[no release]')
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Cache local Maven repository - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: "Login to Quay.io"
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: "Set up Java"
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: "temurin"
- uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v1.12.0 - uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v1.12.0
with: with:
username: ${{ secrets.BOT_GITHUB_USERNAME }} username: ${{ secrets.BOT_GITHUB_USERNAME }}
@@ -54,28 +37,25 @@ jobs:
BUILD_NUMBER: ${{ github.run_number }} BUILD_NUMBER: ${{ github.run_number }}
GIT_USERNAME: ${{ secrets.BOT_GITHUB_USERNAME }} GIT_USERNAME: ${{ secrets.BOT_GITHUB_USERNAME }}
GIT_PASSWORD: ${{ secrets.BOT_GITHUB_PASSWORD }} GIT_PASSWORD: ${{ secrets.BOT_GITHUB_PASSWORD }}
- name: "Clean Maven cache"
Update-downstream: run: bash ./scripts/ci/cleanup_cache.sh
update_downstream:
name: "Update alfresco-enterprise-repo" name: "Update alfresco-enterprise-repo"
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
- Run-CI - run_ci
if: | if: |
always() && always() &&
(needs.Run-CI.result == 'skipped' || needs.Run-CI.result == 'success') && (needs.run_ci.result == 'skipped' || needs.run_ci.result == 'success') &&
! contains(github.event.head_commit.message, '[no downstream]') ! contains(github.event.head_commit.message, '[no downstream]')
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Cache local Maven repository - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- run: bash ./scripts/ci/update_downstream.sh - run: bash ./scripts/ci/update_downstream.sh
env: env:
BRANCH: ${{ github.ref_name }} BRANCH: ${{ github.ref_name }}
COMMIT_MESSAGE: ${{ github.event.head_commit.message }} COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
GIT_USERNAME: ${{ secrets.BOT_GITHUB_USERNAME }} GIT_USERNAME: ${{ secrets.BOT_GITHUB_USERNAME }}
GIT_PASSWORD: ${{ secrets.BOT_GITHUB_PASSWORD }} GIT_PASSWORD: ${{ secrets.BOT_GITHUB_PASSWORD }}
- name: "Clean Maven cache"
run: bash ./scripts/ci/cleanup_cache.sh