diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1dd56a54f5..6a5b161211 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -99,8 +99,8 @@ jobs: mvn -B test -pl core,data-model -am -DfailIfNoTests=false mvn -B test -pl "repository,mmt" -am "-Dtest=AllUnitTestsSuite,AllMmtUnitTestSuite" -DfailIfNoTests=false - Repository-AppContext01TestSuite: - name: "Repository - AppContext01TestSuite" + Repository-AppContextTestSuites: + name: Repository - ${{ matrix.testSuite }} runs-on: ubuntu-latest needs: - prepare @@ -108,6 +108,23 @@ jobs: ! contains(github.event.head_commit.message, '[skip repo]') && ! contains(github.event.head_commit.message, '[skip tests]') && ! contains(github.event.head_commit.message, '[force]') + strategy: + matrix: + include: + - testSuite: AppContext01TestSuite + profile: with-transform-core-aio + - testSuite: AppContext02TestSuite + profile: default + - testSuite: AppContext03TestSuite + profile: with-transform-core-aio + - testSuite: AppContext04TestSuite + profile: with-transform-core-aio + - testSuite: AppContext06TestSuite + profile: with-transform-core-aio + - testSuite: AppContextExtraTestSuite + profile: with-transform-core-aio + - testSuite: MiscContextTestSuite + profile: with-transform-core-aio steps: - uses: actions/checkout@v3 - name: Cache local Maven repository @@ -128,366 +145,401 @@ jobs: with: java-version: ${{ env.JAVA_VERSION }} distribution: "temurin" - - name: "Set Transformers tag" + - name: "Set up the environment with the transformers" + if: {{ matrix.profile }} == 'with-transform-core-aio' run: | echo "TRANSFORMERS_TAG=$(mvn help:evaluate -Dexpression=dependency.alfresco-transform-core.version -q -DforceStdout)" >> $GITHUB_ENV - name: "Set up the environment" - run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile with-transform-core-aio up -d + run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile ${{ matrix.profile }} up -d - name: "Run tests" - run: mvn -B test -pl repository -am -Dtest=AppContext01TestSuite -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco - - Repository-AppContext05TestSuite: - name: "Repository - AppContext05TestSuite" - runs-on: ubuntu-latest - needs: - - prepare - if: > - ! contains(github.event.head_commit.message, '[skip repo]') && - ! contains(github.event.head_commit.message, '[skip tests]') && - ! contains(github.event.head_commit.message, '[force]') - steps: - - uses: actions/checkout@v3 - - name: Cache local Maven repository - 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" - - name: "Set up the environment" - run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml up -d - - name: "Set HOST_IP" - run: | - mkdir -p "${HOME}/tmp" - cp repository/src/test/resources/realms/alfresco-realm.json "${HOME}/tmp" - echo "HOST_IP=$(hostname -I | cut -f1 -d' ')" >> $GITHUB_ENV - - name: "Run IDS" - run: docker run -d -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin -e DB_VENDOR=h2 -p 8999:8080 -e KEYCLOAK_IMPORT=/tmp/alfresco-realm.json -v $HOME/tmp/alfresco-realm.json:/tmp/alfresco-realm.json alfresco/alfresco-identity-service:1.2 - - name: "Run tests" - run: mvn -B test -pl repository -am -Dtest=AppContext05TestSuite -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco "-Didentity-service.auth-server-url=http://${{ env.HOST_IP }}:8999/auth" - - Repository-SearchTestSuite: - name: "Repository - SearchTestSuite" - runs-on: ubuntu-latest - needs: - - prepare - if: > - ! contains(github.event.head_commit.message, '[skip repo]') && - ! contains(github.event.head_commit.message, '[skip tests]') && - ! contains(github.event.head_commit.message, '[force]') - steps: - - uses: actions/checkout@v3 - - name: Cache local Maven repository - 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" - - name: "Set up the environment" - run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml up -d - - name: "Run tests" - run: mvn -B test -pl repository -am -Dtest=SearchTestSuite -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco -Dindex.subsystem.name=solr6 - - Repository-MariaDB10-2-18-tests: - name: "Repository - MariaDB 10.2.18 tests" - runs-on: ubuntu-latest - needs: - - prepare - if: > - ((github.ref_name == 'master' || contains(github.ref_name, '[release]')) && - ! contains(github.event.head_commit.message, '[skip db]')) || - contains(github.event.head_commit.message, '[db]') && - ! contains(github.event.head_commit.message, '[skip tests]') && - ! contains(github.event.head_commit.message, '[force]') - steps: - - uses: actions/checkout@v3 - - name: Cache local Maven repository - 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" - - name: "Set up the environment" - run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile mariadb up -d - env: - MARIADB_VERSION: 10.2.18 - - 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 - - Remote-api-AppContext01TestSuite: - name: "Remote-api - AppContext01TestSuite" - runs-on: ubuntu-latest - needs: - - prepare - if: > - ! contains(github.event.head_commit.message, '[skip repo]') && - ! contains(github.event.head_commit.message, '[skip tests]') && - ! contains(github.event.head_commit.message, '[force]') - env: - REQUIRES_INSTALLED_ARTIFACTS: true - steps: - - uses: actions/checkout@v3 - - name: Cache local Maven repository - 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" - - name: "Build" - timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} - run: | - bash ./scripts/ci/init.sh - bash ./scripts/ci/build.sh - - name: "Set up the environment" - run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml up -d - - name: "Run tests" - run: mvn -B test -pl remote-api -Dtest=AppContext01TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco - - Remote-api-AppContext02TestSuite: - name: "Remote-api - AppContext02TestSuite" - runs-on: ubuntu-latest - needs: - - prepare - if: > - ! contains(github.event.head_commit.message, '[skip repo]') && - ! contains(github.event.head_commit.message, '[skip tests]') && - ! contains(github.event.head_commit.message, '[force]') - env: - REQUIRES_INSTALLED_ARTIFACTS: true - steps: - - uses: actions/checkout@v3 - - name: Cache local Maven repository - 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" - - name: "Build" - timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} - run: | - echo "TRANSFORMERS_TAG=$(mvn help:evaluate -Dexpression=dependency.alfresco-transform-core.version -q -DforceStdout)" >> $GITHUB_ENV - bash ./scripts/ci/init.sh - bash ./scripts/ci/build.sh - - name: "Set up the environment" - run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile with-transform-core-aio up -d - - name: "Run tests" - run: mvn -B test -pl remote-api -Dtest=AppContext02TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco - - REST-API-TAS-tests-part1: - name: "REST API TAS tests part1" - runs-on: ubuntu-latest - needs: - - prepare - if: > - ((github.ref_name == 'master' || contains(github.ref_name, '[release]') || github.event_name == 'pull_request' ) && - ! contains(github.event.head_commit.message, '[skip tas]')) || - contains(github.event.head_commit.message, '[tas]') && - ! contains(github.event.head_commit.message, '[skip tests]') && - ! contains(github.event.head_commit.message, '[force]') - env: - REQUIRES_LOCAL_IMAGES: true - steps: - - uses: actions/checkout@v3 - - name: Cache local Maven repository - 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" - - name: "Build" - timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} - run: | - bash ./scripts/ci/init.sh - bash ./scripts/ci/build.sh - - name: "Set up the environment" - run: | - ${{ env.TAS_SCRIPTS }}/start-compose.sh ${{ env.TAS_ENVIRONMENT }}/docker-compose-minimal+transforms.yml - ${{ env.TAS_SCRIPTS }}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco" - - name: "Run tests" - timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} - run: mvn -B verify -Pall-tas-tests,run-restapi-part1 -Denvironment=default -DrunBugs=false - - AGS-Unit-And_Integration-Tests-01-PostgreSQL: - name: "AGS Unit & Integration Tests 01 (PostgreSQL)" - runs-on: ubuntu-latest - needs: - - prepare - if: > - ((github.ref_name == 'master' || contains(github.ref_name, '[release]') || github.event_name == 'pull_request' ) && - ! contains(github.event.head_commit.message, '[skip ags]')) || - contains(github.event.head_commit.message, '[ags]') && - ! contains(github.event.head_commit.message, '[skip tests]') && - ! contains(github.event.head_commit.message, '[force]') - env: - REQUIRES_INSTALLED_ARTIFACTS: true - steps: - - uses: actions/checkout@v3 - - name: Cache local Maven repository - 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" - - name: "Build" - timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} - run: | - bash ./scripts/ci/init.sh - bash ./scripts/ci/build.sh - - name: "Verify" - 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 -PagsAllTestSuitePt1 ${{ env.LOG_WARN }} - - AGS-Community-Rest-API-Tests: - name: "AGS Community Rest API Tests" - runs-on: ubuntu-latest - needs: - - prepare + 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 +# +# +# Repository-AppContext01TestSuite: +# name: "Repository - AppContext01TestSuite" +# runs-on: ubuntu-latest +# needs: +# - prepare +# if: > +# ! contains(github.event.head_commit.message, '[skip repo]') && +# ! contains(github.event.head_commit.message, '[skip tests]') && +# ! contains(github.event.head_commit.message, '[force]') +# steps: +# - uses: actions/checkout@v3 +# - name: Cache local Maven repository +# 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" +# - name: "Set Transformers tag" +# run: | +# echo "TRANSFORMERS_TAG=$(mvn help:evaluate -Dexpression=dependency.alfresco-transform-core.version -q -DforceStdout)" >> $GITHUB_ENV +# - name: "Set up the environment" +# run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile with-transform-core-aio up -d +# - name: "Run tests" +# run: mvn -B test -pl repository -am -Dtest=AppContext01TestSuite -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco +# +# Repository-AppContext05TestSuite: +# name: "Repository - AppContext05TestSuite" +# runs-on: ubuntu-latest +# needs: +# - prepare +# if: > +# ! contains(github.event.head_commit.message, '[skip repo]') && +# ! contains(github.event.head_commit.message, '[skip tests]') && +# ! contains(github.event.head_commit.message, '[force]') +# steps: +# - uses: actions/checkout@v3 +# - name: Cache local Maven repository +# 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" +# - name: "Set up the environment" +# run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml up -d +# - name: "Set HOST_IP" +# run: | +# mkdir -p "${HOME}/tmp" +# cp repository/src/test/resources/realms/alfresco-realm.json "${HOME}/tmp" +# echo "HOST_IP=$(hostname -I | cut -f1 -d' ')" >> $GITHUB_ENV +# - name: "Run IDS" +# run: docker run -d -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin -e DB_VENDOR=h2 -p 8999:8080 -e KEYCLOAK_IMPORT=/tmp/alfresco-realm.json -v $HOME/tmp/alfresco-realm.json:/tmp/alfresco-realm.json alfresco/alfresco-identity-service:1.2 +# - name: "Run tests" +# run: mvn -B test -pl repository -am -Dtest=AppContext05TestSuite -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco "-Didentity-service.auth-server-url=http://${{ env.HOST_IP }}:8999/auth" +# +# Repository-SearchTestSuite: +# name: "Repository - SearchTestSuite" +# runs-on: ubuntu-latest +# needs: +# - prepare +# if: > +# ! contains(github.event.head_commit.message, '[skip repo]') && +# ! contains(github.event.head_commit.message, '[skip tests]') && +# ! contains(github.event.head_commit.message, '[force]') +# steps: +# - uses: actions/checkout@v3 +# - name: Cache local Maven repository +# 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" +# - name: "Set up the environment" +# run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml up -d +# - name: "Run tests" +# run: mvn -B test -pl repository -am -Dtest=SearchTestSuite -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco -Dindex.subsystem.name=solr6 +# +# Repository-MariaDB10-2-18-tests: +# name: "Repository - MariaDB 10.2.18 tests" +# runs-on: ubuntu-latest +# needs: +# - prepare +# if: > +# ((github.ref_name == 'master' || contains(github.ref_name, '[release]')) && +# ! contains(github.event.head_commit.message, '[skip db]')) || +# contains(github.event.head_commit.message, '[db]') && +# ! contains(github.event.head_commit.message, '[skip tests]') && +# ! contains(github.event.head_commit.message, '[force]') +# steps: +# - uses: actions/checkout@v3 +# - name: Cache local Maven repository +# 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" +# - name: "Set up the environment" +# run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile mariadb up -d +# env: +# MARIADB_VERSION: 10.2.18 +# - 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 +# +# Remote-api-AppContext01TestSuite: +# name: "Remote-api - AppContext01TestSuite" +# runs-on: ubuntu-latest +# needs: +# - prepare +# if: > +# ! contains(github.event.head_commit.message, '[skip repo]') && +# ! contains(github.event.head_commit.message, '[skip tests]') && +# ! contains(github.event.head_commit.message, '[force]') +# env: +# REQUIRES_INSTALLED_ARTIFACTS: true +# steps: +# - uses: actions/checkout@v3 +# - name: Cache local Maven repository +# 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" +# - name: "Build" +# timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} +# run: | +# bash ./scripts/ci/init.sh +# bash ./scripts/ci/build.sh +# - name: "Set up the environment" +# run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml up -d +# - name: "Run tests" +# run: mvn -B test -pl remote-api -Dtest=AppContext01TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco +# +# Remote-api-AppContext02TestSuite: +# name: "Remote-api - AppContext02TestSuite" +# runs-on: ubuntu-latest +# needs: +# - prepare +# if: > +# ! contains(github.event.head_commit.message, '[skip repo]') && +# ! contains(github.event.head_commit.message, '[skip tests]') && +# ! contains(github.event.head_commit.message, '[force]') +# env: +# REQUIRES_INSTALLED_ARTIFACTS: true +# steps: +# - uses: actions/checkout@v3 +# - name: Cache local Maven repository +# 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" +# - name: "Build" +# timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} +# run: | +# echo "TRANSFORMERS_TAG=$(mvn help:evaluate -Dexpression=dependency.alfresco-transform-core.version -q -DforceStdout)" >> $GITHUB_ENV +# bash ./scripts/ci/init.sh +# bash ./scripts/ci/build.sh +# - name: "Set up the environment" +# run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile with-transform-core-aio up -d +# - name: "Run tests" +# run: mvn -B test -pl remote-api -Dtest=AppContext02TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco +# +# REST-API-TAS-tests-part1: +# name: "REST API TAS tests part1" +# runs-on: ubuntu-latest +# needs: +# - prepare +# if: > +# ((github.ref_name == 'master' || contains(github.ref_name, '[release]') || github.event_name == 'pull_request' ) && +# ! contains(github.event.head_commit.message, '[skip tas]')) || +# contains(github.event.head_commit.message, '[tas]') && +# ! contains(github.event.head_commit.message, '[skip tests]') && +# ! contains(github.event.head_commit.message, '[force]') +# env: +# REQUIRES_LOCAL_IMAGES: true +# steps: +# - uses: actions/checkout@v3 +# - name: Cache local Maven repository +# 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" +# - name: "Build" +# timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} +# run: | +# bash ./scripts/ci/init.sh +# bash ./scripts/ci/build.sh +# - name: "Set up the environment" +# run: | +# ${{ env.TAS_SCRIPTS }}/start-compose.sh ${{ env.TAS_ENVIRONMENT }}/docker-compose-minimal+transforms.yml +# ${{ env.TAS_SCRIPTS }}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco" +# - name: "Run tests" +# timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} +# run: mvn -B verify -Pall-tas-tests,run-restapi-part1 -Denvironment=default -DrunBugs=false +# +# AGS-Unit-And_Integration-Tests-01-PostgreSQL: +# name: "AGS Unit & Integration Tests 01 (PostgreSQL)" +# runs-on: ubuntu-latest +# needs: +# - prepare # if: > # ((github.ref_name == 'master' || contains(github.ref_name, '[release]') || github.event_name == 'pull_request' ) && # ! contains(github.event.head_commit.message, '[skip ags]')) || # contains(github.event.head_commit.message, '[ags]') && # ! contains(github.event.head_commit.message, '[skip tests]') && # ! contains(github.event.head_commit.message, '[force]') - if: > - ! contains(github.event.head_commit.message, '[skip repo]') && - ! contains(github.event.head_commit.message, '[skip tests]') && - ! contains(github.event.head_commit.message, '[force]') - steps: - - uses: actions/checkout@v3 - - name: Cache local Maven repository - 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: "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" - - name: "build" - timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} - run: bash ./scripts/ci/build.sh - env: - REQUIRES_LOCAL_IMAGES: true - - name: "Set up the environment" - run: | - ${{ env.TAS_SCRIPTS }}/start-compose.sh ./amps/ags/rm-community/rm-community-repo/docker-compose.yml - ${{ env.TAS_SCRIPTS }}/wait-for-alfresco-start.sh "http://localhost:8080/alfresco" - - name: "test" - timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} - run: mvn -B test -pl :alfresco-governance-services-automation-community-rest-api -am -DfailIfNoTests=false -Dskip.automationtests=false -Pags - - run: bash amps/ags/ci/scripts/getLogs.sh - if: ${{ always() }} - - shell: bash - if: ${{ always() }} - run: | - mkdir -p deploy_dir/community/${{ github.run_number }}/AGS-Community-Rest-API-Tests - mv "alfresco.log" "deploy_dir/community/${{ github.run_number }}/AGS-Community-Rest-API-Tests" - mv "solr.log" "deploy_dir/community/${{ github.run_number }}/AGS-Community-Rest-API-Tests" - mv "./amps/ags/rm-automation/rm-automation-community-rest-api/target/reports" "deploy_dir/community/${{ github.run_number }}/AGS-Community-Rest-API-Tests" - - name: "Configure AWS credentials" - if: ${{ always() }} - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AGS_AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AGS_AWS_SECRET_ACCESS_KEY }} - aws-region: us-east-1 - - name: "Upload artifacts to Amazon S3 bucket" - if: ${{ always() }} - run: aws s3 cp --recursive ./deploy_dir s3://ags-travis-artifacts \ No newline at end of file +# env: +# REQUIRES_INSTALLED_ARTIFACTS: true +# steps: +# - uses: actions/checkout@v3 +# - name: Cache local Maven repository +# 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" +# - name: "Build" +# timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} +# run: | +# bash ./scripts/ci/init.sh +# bash ./scripts/ci/build.sh +# - name: "Verify" +# 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 -PagsAllTestSuitePt1 ${{ env.LOG_WARN }} +# +# AGS-Community-Rest-API-Tests: +# name: "AGS Community Rest API Tests" +# runs-on: ubuntu-latest +# needs: +# - prepare +# if: > +# ((github.ref_name == 'master' || contains(github.ref_name, '[release]') || github.event_name == 'pull_request' ) && +# ! contains(github.event.head_commit.message, '[skip ags]')) || +# contains(github.event.head_commit.message, '[ags]') && +# ! contains(github.event.head_commit.message, '[skip tests]') && +# ! contains(github.event.head_commit.message, '[force]') +# steps: +# - uses: actions/checkout@v3 +# - name: Cache local Maven repository +# 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: "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" +# - name: "Build" +# timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} +# run: bash ./scripts/ci/build.sh +# env: +# REQUIRES_LOCAL_IMAGES: true +# - name: "Set up the environment" +# run: | +# ${{ env.TAS_SCRIPTS }}/start-compose.sh ./amps/ags/rm-community/rm-community-repo/docker-compose.yml +# ${{ env.TAS_SCRIPTS }}/wait-for-alfresco-start.sh "http://localhost:8080/alfresco" +# - name: "Test" +# timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} +# run: mvn -B test -pl :alfresco-governance-services-automation-community-rest-api -am -DfailIfNoTests=false -Dskip.automationtests=false -Pags +# - run: bash amps/ags/ci/scripts/getLogs.sh +# if: ${{ always() }} +# - shell: bash +# if: ${{ always() }} +# run: | +# mkdir -p deploy_dir/community/${{ github.run_number }}/AGS-Community-Rest-API-Tests +# mv "alfresco.log" "deploy_dir/community/${{ github.run_number }}/AGS-Community-Rest-API-Tests" +# mv "solr.log" "deploy_dir/community/${{ github.run_number }}/AGS-Community-Rest-API-Tests" +# mv "./amps/ags/rm-automation/rm-automation-community-rest-api/target/reports" "deploy_dir/community/${{ github.run_number }}/AGS-Community-Rest-API-Tests" +# - name: "Configure AWS credentials" +# if: ${{ always() }} +# uses: aws-actions/configure-aws-credentials@v1 +# with: +# aws-access-key-id: ${{ secrets.AGS_AWS_ACCESS_KEY_ID }} +# aws-secret-access-key: ${{ secrets.AGS_AWS_SECRET_ACCESS_KEY }} +# aws-region: us-east-1 +# - name: "Upload artifacts to Amazon S3 bucket" +# if: ${{ always() }} +# run: aws s3 cp --recursive ./deploy_dir s3://ags-travis-artifacts \ No newline at end of file diff --git a/.github/workflows/master_release.yml b/.github/workflows/master_release.yml index 8813baa2b0..de2acdcf56 100644 --- a/.github/workflows/master_release.yml +++ b/.github/workflows/master_release.yml @@ -24,8 +24,13 @@ jobs: ! contains(github.event.head_commit.message, '[no release]') steps: - uses: actions/checkout@v3 - - run: mkdir -p $HOME/.m2 - - run: cp .travis.settings.xml $HOME/.m2 + - name: Cache local Maven repository + 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: @@ -37,7 +42,6 @@ jobs: with: java-version: ${{ env.JAVA_VERSION }} distribution: "temurin" - cache: "maven" - uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v1.12.0 with: username: ${{ secrets.BOT_GITHUB_USERNAME }} @@ -45,7 +49,7 @@ jobs: - name: "Verify release tag" run: bash ./scripts/travis/verify_release_tag.sh - name: "Release" - run: bash ./scripts/gh-actions/maven_release.sh + run: bash ./scripts/ci/maven_release.sh env: BUILD_NUMBER: ${{ github.run_number }} GIT_USERNAME: ${{ secrets.BOT_GITHUB_USERNAME }} @@ -62,9 +66,14 @@ jobs: ! contains(github.event.head_commit.message, '[no downstream]') steps: - uses: actions/checkout@v3 - - run: mkdir -p $HOME/.m2 - - run: cp .travis.settings.xml $HOME/.m2 - - run: bash ./scripts/gh-actions/update_downstream.sh + - name: Cache local Maven repository + 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 env: BRANCH: ${{ github.ref_name }} COMMIT_MESSAGE: ${{ github.event.head_commit.message }} diff --git a/scripts/ci/build_functions.sh b/scripts/ci/build_functions.sh index 5aedd3eb65..c65cadd50b 100644 --- a/scripts/ci/build_functions.sh +++ b/scripts/ci/build_functions.sh @@ -5,7 +5,7 @@ function cloneRepo() { local REPO="${1}" local TAG_OR_BRANCH="${2}" - printf "Clonning \"%s\" on %s\n" "${TAG_OR_BRANCH}" "${REPO}" + printf "Cloning \"%s\" on %s\n" "${TAG_OR_BRANCH}" "${REPO}" # clone the repository branch/tag pushd "$(dirname "${BASH_SOURCE[0]}")/../../../" >/dev/null diff --git a/scripts/ci/docker-compose/docker-compose.yaml b/scripts/ci/docker-compose/docker-compose.yaml index 32bfabfdba..e8f3309efc 100644 --- a/scripts/ci/docker-compose/docker-compose.yaml +++ b/scripts/ci/docker-compose/docker-compose.yaml @@ -10,6 +10,7 @@ services: - "8090:8090" postgres: image: postgres:14.4 + profiles: ["default", "with-transform-core-aio"] environment: - POSTGRES_PASSWORD=alfresco - POSTGRES_USER=alfresco @@ -18,6 +19,7 @@ services: ports: - "5433:5432" activemq: + profiles: ["default", "with-transform-core-aio"] image: alfresco/alfresco-activemq:5.17.1-jre11-rockylinux8 ports: - "5672:5672" # AMQP