From f58ca49b060275ef66eb5833588fbf6931a7a17c Mon Sep 17 00:00:00 2001 From: "Damian.Ujma@hyland.com" Date: Wed, 31 Aug 2022 09:52:33 +0200 Subject: [PATCH] ACS-3465 Add AGS-Community-Rest-API-Tests --- .github/workflows/ci.yml | 84 +++++++--------------------- .github/workflows/master_release.yml | 73 ++++++++++++++++++++++++ 2 files changed, 92 insertions(+), 65 deletions(-) create mode 100644 .github/workflows/master_release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 62a2f0acca..a1f830d725 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,12 @@ name: Alfresco Community Repo CI -on: push +on: + pull_request: + push: + branches-ignore: + - master + - release/** + workflow_call: env: # Both variables are required to be set before the release process starts. @@ -330,7 +336,11 @@ jobs: with: java-version: ${{ env.JAVA_VERSION }} distribution: "temurin" - cache: "maven" + - name: "Setup Maven Action" + uses: s4u/setup-maven-action@v1.5.0 + with: + java-version: ${{ env.JAVA_VERSION }} + maven-version: 3.5.4 - name: "build" timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} run: bash ./scripts/travis/build.sh @@ -345,14 +355,13 @@ jobs: run: mvn --settings .travis.settings.xml -B test -pl :alfresco-governance-services-automation-community-rest-api -am -DfailIfNoTests=false -Dskip.automationtests=false -Pags - run: bash amps/ags/travis/scripts/getLogs.sh if: ${{ always() }} - - run: mkdir -p deploy_dir/community/${{ github.run_number }}/AGS-Community-Rest-API-Tests - if: ${{ always() }} - - run: mv "alfresco.log" "deploy_dir/community/${{ github.run_number }}/AGS-Community-Rest-API-Tests" - if: ${{ always() }} - - run: mv "solr.log" "deploy_dir/community/${{ github.run_number }}/AGS-Community-Rest-API-Tests" - if: ${{ always() }} - - run: mv "./amps/ags/rm-automation/rm-automation-community-rest-api/target/reports" "deploy_dir/community/${{ github.run_number }}/AGS-Community-Rest-API-Tests" + - 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 @@ -362,59 +371,4 @@ jobs: aws-region: us-east-1 - name: "Upload build artifacts to Amazon S3" if: ${{ always() }} - run: aws s3 cp --recursive ./deploy_dir s3://ags-travis-artifacts - - Push-to-Nexus: - runs-on: ubuntu-latest - if: > - (github.ref_name == 'master' || contains(github.ref_name, 'release/')) && - github.event_name != 'pull_request' && - ! contains(github.event.head_commit.message, '[no release]') - needs: - - AGS-Community-Rest-API-Tests - steps: - - uses: actions/checkout@v3 - - run: mkdir -p $HOME/.m2 - - run: cp .travis.settings.xml $HOME/.m2 - - 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" - cache: "maven" - - uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v1.12.0 - with: - username: ${{ secrets.BOT_GITHUB_USERNAME }} - email: ${{ secrets.BOT_GITHUB_EMAIL }} - - name: "Verify release tag" - run: bash ./scripts/travis/verify_release_tag.sh - - name: "Release" - run: bash ./scripts/gh-actions/maven_release.sh - env: - BUILD_NUMBER: ${{ github.run_number }} - GIT_USERNAME: ${{ secrets.BOT_GITHUB_USERNAME }} - GIT_PASSWORD: ${{ secrets.BOT_GITHUB_PASSWORD }} - Update-downstream: - runs-on: ubuntu-latest - if: > - (github.ref_name == 'master' || contains(github.ref_name, 'release/')) && - github.event_name != 'pull_request' && - ! contains(github.event.head_commit.message, '[no downstream]') - needs: - - AGS-Community-Rest-API-Tests - 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 - 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 + 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 new file mode 100644 index 0000000000..9999fae0ed --- /dev/null +++ b/.github/workflows/master_release.yml @@ -0,0 +1,73 @@ +name: Master/Release branch workflow + +env: + JAVA_VERSION: "17" + +on: + push: + branches: + - master + - release/** + +jobs: + run-ci: + uses: ./.github/workflows/ci.yml + secrets: inherit + Push-to-Nexus: + runs-on: ubuntu-latest + if: | + always() && + (needs.run-ci.result == 'skipped' || needs.run-ci.result == 'success') && + (github.ref_name == 'master' || contains(github.ref_name, 'release/')) && + github.event_name != 'pull_request' && + ! contains(github.event.head_commit.message, '[no release]') + needs: + - AGS-Community-Rest-API-Tests + steps: + - uses: actions/checkout@v3 + - run: mkdir -p $HOME/.m2 + - run: cp .travis.settings.xml $HOME/.m2 + - 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" + cache: "maven" + - uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v1.12.0 + with: + username: ${{ secrets.BOT_GITHUB_USERNAME }} + email: ${{ secrets.BOT_GITHUB_EMAIL }} + - name: "Verify release tag" + run: bash ./scripts/travis/verify_release_tag.sh + - name: "Release" + run: bash ./scripts/gh-actions/maven_release.sh + env: + BUILD_NUMBER: ${{ github.run_number }} + GIT_USERNAME: ${{ secrets.BOT_GITHUB_USERNAME }} + GIT_PASSWORD: ${{ secrets.BOT_GITHUB_PASSWORD }} + Update-downstream: + runs-on: ubuntu-latest + if: | + always() && + (needs.run-ci.result == 'skipped' || needs.run-ci.result == 'success') && + (github.ref_name == 'master' || contains(github.ref_name, 'release/')) && + github.event_name != 'pull_request' && + ! contains(github.event.head_commit.message, '[no downstream]') + needs: + - AGS-Community-Rest-API-Tests + 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 + 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