diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f5a5a3c3e8..dded0e12b8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,7 @@ on: env: DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }} + CACHE_CLEANUP_SCRIPT: ./scripts/ci/cleanup_cache.sh GITHUB_ACTIONS_DEPLOY_TIMEOUT: 60 JAVA_VERSION: "17" 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 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: name: "Prepare" + needs: configure_env runs-on: ubuntu-latest if: > ! 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: "Clean cache" - run: bash ./scripts/ci/cleanup_cache.sh + - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools - name: "Prepare environment" run: bash ./scripts/ci/prepare.sh @@ -65,8 +67,10 @@ jobs: - uses: Alfresco/alfresco-build-tools/.github/actions/veracode@master with: srcclr-api-token: ${{ secrets.SRCCLR_API_TOKEN }} - - AllUnitTestsSuite: + - name: "Clean Maven cache" + run: bash ./scripts/ci/cleanup_cache.sh + + all_unit_tests_suite: name: "Core, Data-Model, Repository - AllUnitTestsSuite - Build and test" runs-on: ubuntu-latest needs: @@ -77,24 +81,15 @@ jobs: ! 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: "Set up Java" - uses: actions/setup-java@v3 - with: - java-version: ${{ env.JAVA_VERSION }} - distribution: "temurin" + - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools - name: "Run tests" run: | mvn -B test -pl core,data-model -am -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 }} runs-on: ubuntu-latest needs: @@ -108,31 +103,21 @@ jobs: matrix: include: - testSuite: AppContext01TestSuite - profile: default + compose-profile: default - testSuite: AppContext02TestSuite - profile: with-transform-core-aio + compose-profile: with-transform-core-aio - testSuite: AppContext03TestSuite - profile: with-transform-core-aio + compose-profile: with-transform-core-aio - testSuite: AppContext04TestSuite - profile: with-transform-core-aio + compose-profile: with-transform-core-aio - testSuite: AppContextExtraTestSuite - profile: default + compose-profile: default 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: "Set up Java" - uses: actions/setup-java@v3 - with: - java-version: ${{ env.JAVA_VERSION }} - distribution: "temurin" + - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools + - name: "Build" timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} run: | @@ -141,11 +126,13 @@ jobs: - 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 ${{ matrix.profile }} up -d + run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile ${{ matrix.compose-profile }} up -d - 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 + - name: "Clean Maven cache" + run: bash ./scripts/ci/cleanup_cache.sh - Repository-MariaDB-tests: + repository_mariadb_tests: name: Repository - MariaDB ${{ matrix.version }} tests runs-on: ubuntu-latest needs: @@ -162,26 +149,17 @@ jobs: version: ['10.2.18', '10.4', '10.5'] 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: "Set up Java" - uses: actions/setup-java@v3 - with: - java-version: ${{ env.JAVA_VERSION }} - distribution: "temurin" + - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools - name: "Set up the environment" run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile mariadb up -d env: MARIADB_VERSION: ${{ matrix.version }} - 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 + - 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" runs-on: ubuntu-latest needs: @@ -195,26 +173,17 @@ jobs: ! 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: "Set up Java" - uses: actions/setup-java@v3 - with: - java-version: ${{ env.JAVA_VERSION }} - distribution: "temurin" + - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools - 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.6 - 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 + - name: "Clean Maven cache" + run: bash ./scripts/ci/cleanup_cache.sh - Repository-MySQL-tests: + repository_mysql_tests: name: Repository - MySQL 8 tests runs-on: ubuntu-latest needs: @@ -228,26 +197,17 @@ jobs: ! 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: "Set up Java" - uses: actions/setup-java@v3 - with: - java-version: ${{ env.JAVA_VERSION }} - distribution: "temurin" + - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools - name: "Set up the environment" run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile mysql up -d env: MYSQL_VERSION: 8 - 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 + - 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" runs-on: ubuntu-latest needs: @@ -260,26 +220,17 @@ jobs: ! 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: "Set up Java" - uses: actions/setup-java@v3 - with: - java-version: ${{ env.JAVA_VERSION }} - distribution: "temurin" + - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools - name: "Set up the environment" run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile postgres up -d env: POSTGRES_VERSION: 10.6 - 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 + - 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" runs-on: ubuntu-latest needs: @@ -293,26 +244,17 @@ jobs: ! 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: "Set up Java" - uses: actions/setup-java@v3 - with: - java-version: ${{ env.JAVA_VERSION }} - distribution: "temurin" + - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools - name: "Set up the environment" run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile postgres up -d env: POSTGRES_VERSION: 14.4 - 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 + - name: "Clean Maven cache" + run: bash ./scripts/ci/cleanup_cache.sh - Repository-Messaging-tests: + repository_messaging_tests: name: Repository - Messaging tests runs-on: ubuntu-latest needs: @@ -324,23 +266,15 @@ jobs: 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: "Set up Java" - uses: actions/setup-java@v3 - with: - java-version: ${{ env.JAVA_VERSION }} - distribution: "temurin" + - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools - name: "Set up the environment" run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile activemq up -d - name: "Run tests" 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 }} runs-on: ubuntu-latest needs: @@ -354,39 +288,28 @@ jobs: matrix: include: - testSuite: AppContext01TestSuite - profile: with-transform-core-aio + compose-profile: with-transform-core-aio - testSuite: AppContext02TestSuite - profile: default + compose-profile: default - testSuite: AppContext03TestSuite - profile: with-transform-core-aio + compose-profile: with-transform-core-aio - testSuite: AppContext04TestSuite - profile: with-transform-core-aio + compose-profile: with-transform-core-aio - testSuite: AppContext05TestSuite - profile: default + compose-profile: default parameters: '"-Didentity-service.auth-server-url=http://${HOST_IP}:8999/auth"' - testSuite: AppContext06TestSuite - profile: with-transform-core-aio + compose-profile: with-transform-core-aio - testSuite: AppContextExtraTestSuite - profile: with-transform-core-aio + compose-profile: with-transform-core-aio - testSuite: MiscContextTestSuite - profile: with-transform-core-aio + compose-profile: with-transform-core-aio - testSuite: SearchTestSuite - profile: default + compose-profile: default parameters: '-Dindex.subsystem.name=solr6' 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: "Set up Java" - uses: actions/setup-java@v3 - with: - java-version: ${{ env.JAVA_VERSION }} - distribution: "temurin" + - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools - name: "Set up IDS" run: | if [ "${{ matrix.testSuite }}" == 'AppContext05TestSuite' ]; @@ -399,11 +322,13 @@ jobs: - 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 ${{ matrix.profile }} up -d + run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile ${{ matrix.compose-profile }} up -d - 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 }} + - name: "Clean Maven cache" + run: bash ./scripts/ci/cleanup_cache.sh - TAS-Tests: + tas-tests: name: ${{ matrix.test-name }} runs-on: ubuntu-latest needs: @@ -446,18 +371,7 @@ jobs: 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: "Set up Java" - uses: actions/setup-java@v3 - with: - java-version: ${{ env.JAVA_VERSION }} - distribution: "temurin" + - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools - name: "Build" timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} run: | @@ -476,8 +390,10 @@ jobs: - name: "Run tests" 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 + - name: "Clean Maven cache" + run: bash ./scripts/ci/cleanup_cache.sh - Share-Services-ShareServicesTestSuite: + share_services_share_services_test_suite: name: Share Services - ShareServicesTestSuite runs-on: ubuntu-latest needs: @@ -488,24 +404,15 @@ jobs: ! 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: "Set up Java" - uses: actions/setup-java@v3 - with: - java-version: ${{ env.JAVA_VERSION }} - distribution: "temurin" + - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools - name: "Set up the environment" run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile postgres up -d - 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 + - 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 }} runs-on: ubuntu-latest needs: @@ -524,18 +431,7 @@ jobs: 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: "Set up Java" - uses: actions/setup-java@v3 - with: - java-version: ${{ env.JAVA_VERSION }} - distribution: "temurin" + - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools - name: "Build" timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} run: | @@ -544,8 +440,10 @@ jobs: - 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 -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 }} runs-on: ubuntu-latest needs: @@ -564,18 +462,7 @@ jobs: 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: "Set up Java" - uses: actions/setup-java@v3 - with: - java-version: ${{ env.JAVA_VERSION }} - distribution: "temurin" + - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools - name: "Build" timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} run: | @@ -584,8 +471,10 @@ jobs: - 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-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" runs-on: ubuntu-latest needs: @@ -600,23 +489,7 @@ jobs: 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 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" + - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools - name: "Build" timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} run: | @@ -647,4 +520,6 @@ jobs: 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 + run: aws s3 cp --recursive ./deploy_dir s3://ags-travis-artifacts + - name: "Clean Maven cache" + run: bash ./scripts/ci/cleanup_cache.sh \ No newline at end of file diff --git a/.github/workflows/master_release.yml b/.github/workflows/master_release.yml index f560efb000..55700c6504 100644 --- a/.github/workflows/master_release.yml +++ b/.github/workflows/master_release.yml @@ -10,38 +10,21 @@ on: - release/** jobs: - Run-CI: + run_ci: uses: ./.github/workflows/ci.yml secrets: inherit - Push-to-Nexus: + push_to_nexus: name: "Push to Nexus" runs-on: ubuntu-latest needs: - - Run-CI + - run_ci if: | 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]') 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" + - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools - uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v1.12.0 with: username: ${{ secrets.BOT_GITHUB_USERNAME }} @@ -54,28 +37,25 @@ jobs: BUILD_NUMBER: ${{ github.run_number }} GIT_USERNAME: ${{ secrets.BOT_GITHUB_USERNAME }} GIT_PASSWORD: ${{ secrets.BOT_GITHUB_PASSWORD }} - - Update-downstream: + - name: "Clean Maven cache" + run: bash ./scripts/ci/cleanup_cache.sh + update_downstream: name: "Update alfresco-enterprise-repo" runs-on: ubuntu-latest needs: - - Run-CI + - run_ci if: | 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]') 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- + - uses: Alfresco/acs-community-packaging@feature/ACS-3844_migrate-to-GHA/.github/actions/setup-build-tools - run: bash ./scripts/ci/update_downstream.sh env: BRANCH: ${{ github.ref_name }} COMMIT_MESSAGE: ${{ github.event.head_commit.message }} GIT_USERNAME: ${{ secrets.BOT_GITHUB_USERNAME }} - GIT_PASSWORD: ${{ secrets.BOT_GITHUB_PASSWORD }} \ No newline at end of file + GIT_PASSWORD: ${{ secrets.BOT_GITHUB_PASSWORD }} + - name: "Clean Maven cache" + run: bash ./scripts/ci/cleanup_cache.sh \ No newline at end of file