From 05d5b14bfba457d199d14bb353a78f98b1f5e975 Mon Sep 17 00:00:00 2001 From: Emanuela Epure <67077116+emanuelaepure10@users.noreply.github.com> Date: Mon, 4 Mar 2024 22:37:28 +0100 Subject: [PATCH] build: migrate build to GitHub Actions Add pull request file, master and release branches files to be used by the GitHub actions to check the PRs. ING-4164 --- .github/workflows/check.yml | 68 ++++++++++++++++------------------- .github/workflows/publish.yml | 54 ++++++++++++++++++++++++++++ .github/workflows/release.yml | 54 ++++++++++++++++++++++++++++ 3 files changed, 139 insertions(+), 37 deletions(-) create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 205707a59b..ff73e92714 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,43 +1,37 @@ -name: Check +name: Pull Request Workflow -# XXX disabled for now because we use Jenkins still, but at the time this was tested it was functional -# on: -# pull_request: -# branches: [ master ] +on: + pull_request: + branches: + - '*' # Trigger on all branches for pull requests jobs: - check: + build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - # Note: Actually we don't need Maven CLI, only Java 17, but this may have additional benefits due to the Maven cache - - name: Setup Maven - uses: s4u/setup-maven-action@v1.5.1 - with: - java-version: 17 - java-distribution: temurin - maven-version: 3.8.6 - - - name: Clean - run: ./build.sh clean - working-directory: ./build - - - name: Test (commitStage) - run: ./build.sh commitStage - # run: ./build.sh integrationStage - working-directory: ./build - - # https://github.com/marketplace/actions/junit-report-action - - name: Publish Test Report - uses: mikepenz/action-junit-report@v3 - if: always() # always run even if the previous step fails - with: - report_paths: 'build/target/testReports/*.xml' - - # TODO allure report? - # build/target/allure-results - - # TODO archive logs? - # build/target/testReports/*.out,build/target/testReports/*.err + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup JAVA + uses: actions/setup-java@v4 + with: + distribution: 'temurin' # See 'Supported distributions' for available options + java-version: '17' + + - name: Setup Maven + uses: s4u/maven-settings-action@v3.0.0 + + - name: Clean + run: ./build.sh clean + working-directory: ./build + + - name: Test + run: ./build.sh commitStage + working-directory: ./build + + - name: Publish Test Report + uses: mikepenz/action-junit-report@v4 + if: always() # always run even if the previous step fails + with: + report_paths: 'build/target/testReports/*.xml' diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000000..c1e6def7b5 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,54 @@ +name: Master Branch Workflow + +on: + push: + branches: + #- master # Trigger on pushes to the master branch + - build/ING-4164 + workflow_dispatch: {} + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup JAVA + uses: actions/setup-java@v4 + with: + distribution: 'temurin' # See 'Supported distributions' for available options + java-version: '17' + + - name: Setup Maven + uses: s4u/maven-settings-action@v3.0.0 + + - name: Clean + run: ./build.sh clean + working-directory: ./build + + - name: Test + run: ./build.sh integrationStage + working-directory: ./build + + - name: Product + run: ./build.sh product --arch x86_64 --os linux HALE + ./build.sh product --arch x86_64 --os windows HALE + ./build.sh product --arch x86_64 --os macosx HALE + ./build.sh product --arch x86_64 --os linux --publish Infocenter + working-directory: ./build + + - name: Update site + run: ./upload-site.sh + working-directory: ./build + + - name: Deploy Artifacts + run: ./build.sh deployArtifacts + working-directory: ./build + + - name: Publish Test Report + uses: mikepenz/action-junit-report@v4 + if: always() # always run even if the previous step fails + with: + report_paths: 'build/target/testReports/*.xml' \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..007694b663 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,54 @@ +name: Release Branch Workflow + +on: + push: + branches: + - release/* # Trigger on pushes to the master branch + workflow_dispatch: {} + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup JAVA + uses: actions/setup-java@v4 + with: + distribution: 'temurin' # See 'Supported distributions' for available options + java-version: '17' + + - name: Setup Maven + uses: s4u/maven-settings-action@v3.0.0 + + - name: Clean + run: ./build.sh clean + working-directory: ./build + + - name: Test + run: ./build.sh integrationStage + working-directory: ./build + + - name: Product + run: ./build.sh product --arch x86_64 --os linux HALE + ./build.sh product --arch x86_64 --os windows HALE + ./build.sh product --arch x86_64 --os macosx HALE + ./build.sh product --arch x86_64 --os linux --publish Infocenter + working-directory: ./build + + - name: Update site + run: ./upload-site.sh + working-directory: ./build + + - name: Deploy Artifacts + run: ./build.sh deployArtifacts + working-directory: ./build + + - name: Publish Test Report + uses: mikepenz/action-junit-report@v4 + if: always() # always run even if the previous step fails + with: + report_paths: 'build/target/testReports/*.xml' + \ No newline at end of file