From ac6f6afb73d5dadf82f0ba43f60f8ee5855b6164 Mon Sep 17 00:00:00 2001 From: Maryan Hratson Date: Sun, 1 Sep 2024 23:46:03 -0400 Subject: [PATCH 1/5] CI workflow with Github Actions ## Summary - initial PR for the series of the PRs - to migrate circleci to github actions ## Testing Done - TBD --- .github/workflows/ci.yaml | 78 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 000000000..98795e81a --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,78 @@ +name: CI + +on: + push: + branches: ['main'] + pull_request: + types: [ opened, synchronize, reopened ] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +jobs: + test: + name: "test with JDK=${{matrix.java-dist}}:${{matrix.java-ver}}" + runs-on: [ubuntu-latest] + strategy: + fail-fast: false + matrix: + java-ver: [11] + java-dist: ['microsoft', 'temurin'] + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # so gradle doesn't fail traversing the history + - uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.java-ver }} + distribution: ${{ matrix.java-dist }} + # see: https://github.com/gradle/actions/blob/main/setup-gradle/README.md + - uses: gradle/actions/setup-gradle@v4 # v4.0.0 + - name: gradle build + run: ./gradlew --no-daemon -PmaxParallelForks=1 build + + integration-test: + name: "integration-test with JDK=${{matrix.java-dist}}:${{matrix.java-ver}}" + runs-on: [ubuntu-latest] + strategy: + fail-fast: false + matrix: + java-ver: [11] + java-dist: ['microsoft', 'temurin'] + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # so gradle doesn't fail traversing the history + - uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.java-ver }} + distribution: ${{ matrix.java-dist }} + # see: https://github.com/gradle/actions/blob/main/setup-gradle/README.md + - uses: gradle/actions/setup-gradle@v4 # v4.0.0 + - name: gradle integration test + run: ./gradlew --no-daemon -PmaxParallelForks=1 clean integrationTest + + build-platform: + name: platform build with JDK=${{matrix.java-dist}}:${{matrix.java-ver}} on ${{matrix.hw_platform}} + strategy: + fail-fast: false + matrix: + java-ver: [11] + java-dist: ['temurin'] + hw_platform: ['s390x'] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # so gradle doesn't fail traversing the history + - run: | + # install required qemu libraries + docker run --rm --privileged tonistiigi/binfmt:latest --install all + # run docker container with qemu emulation + docker run --rm \ + --platform ${{ matrix.hw_platform }} \ + --name qemu-cross-${{ matrix.hw_platform }} \ + --mount type=bind,source=${PWD},target=/workspace \ + --workdir /workspace \ + ${{matrix.hw_platform}}/eclipse-temurin:11-jdk-focal uname -a; ./gradlew --no-daemon -PmaxParallelForks=1 build From 58c78019e265fa05085b680ee2b3e910b701bb77 Mon Sep 17 00:00:00 2001 From: Maryan Hratson Date: Wed, 4 Sep 2024 22:19:38 -0400 Subject: [PATCH 2/5] add gradle caching --- .github/workflows/ci.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 98795e81a..fb450d9c8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -27,6 +27,7 @@ jobs: with: java-version: ${{ matrix.java-ver }} distribution: ${{ matrix.java-dist }} + cache: gradle # see: https://github.com/gradle/actions/blob/main/setup-gradle/README.md - uses: gradle/actions/setup-gradle@v4 # v4.0.0 - name: gradle build @@ -48,6 +49,7 @@ jobs: with: java-version: ${{ matrix.java-ver }} distribution: ${{ matrix.java-dist }} + cache: gradle # see: https://github.com/gradle/actions/blob/main/setup-gradle/README.md - uses: gradle/actions/setup-gradle@v4 # v4.0.0 - name: gradle integration test From 6382402081236fe7280caf11b41f53f806d7b369 Mon Sep 17 00:00:00 2001 From: Maryan Hratson Date: Wed, 4 Sep 2024 23:24:29 -0400 Subject: [PATCH 3/5] Create artifactory.yaml --- .github/workflows/artifactory.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/artifactory.yaml diff --git a/.github/workflows/artifactory.yaml b/.github/workflows/artifactory.yaml new file mode 100644 index 000000000..6eaf7d07d --- /dev/null +++ b/.github/workflows/artifactory.yaml @@ -0,0 +1,25 @@ +name: Artifactory + +on: + workflow_dispatch: # manual trigger + release: + types: [published] + +jobs: + publish: + # if: startsWith(github.event.ref, 'release/') + name: publish + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # so gradle doesn't fail traversing the history + - uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.java-ver }} + distribution: ${{ matrix.java-dist }} + cache: gradle + - uses: gradle/actions/setup-gradle@v4 # v4.0.0 + - name: publish + run: | + ./gradlew :artifactoryPublish :cruise-control:artifactoryPublish :cruise-control-core:artifactoryPublish :cruise-control-metrics-reporter:artifactoryPublish From f56b09ee2b7c851ba63e8c3e154ca9c8fe366c13 Mon Sep 17 00:00:00 2001 From: Maryan Hratson Date: Wed, 4 Sep 2024 23:25:06 -0400 Subject: [PATCH 4/5] Update artifactory.yaml --- .github/workflows/artifactory.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/artifactory.yaml b/.github/workflows/artifactory.yaml index 6eaf7d07d..d942b7b7c 100644 --- a/.github/workflows/artifactory.yaml +++ b/.github/workflows/artifactory.yaml @@ -16,8 +16,8 @@ jobs: fetch-depth: 0 # so gradle doesn't fail traversing the history - uses: actions/setup-java@v4 with: - java-version: ${{ matrix.java-ver }} - distribution: ${{ matrix.java-dist }} + java-version: 11 + distribution: microsoft cache: gradle - uses: gradle/actions/setup-gradle@v4 # v4.0.0 - name: publish From 5565c6b04a7137a5c14c5606489f3e2bcf02bbc4 Mon Sep 17 00:00:00 2001 From: Maryan Hratson Date: Fri, 6 Sep 2024 13:29:21 -0400 Subject: [PATCH 5/5] Update artifactory.yaml disable event handler until circleCI workflow is disabled to avoid race --- .github/workflows/artifactory.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/artifactory.yaml b/.github/workflows/artifactory.yaml index d942b7b7c..490047c88 100644 --- a/.github/workflows/artifactory.yaml +++ b/.github/workflows/artifactory.yaml @@ -2,8 +2,8 @@ name: Artifactory on: workflow_dispatch: # manual trigger - release: - types: [published] + #release: + # types: [published] jobs: publish: