From e75a2b8d50e56b34099634a96840a09f2db626f2 Mon Sep 17 00:00:00 2001 From: Evgeny Malygin Date: Fri, 27 Oct 2023 01:05:08 +0300 Subject: [PATCH 1/3] Full UT/IT run in publish Signed-off-by: Evgeny Malygin --- .github/workflows/publish.yaml | 44 +++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 808076d..e02e54d 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -22,8 +22,50 @@ jobs: server-password: OSSRH_PASSWORD gpg-private-key: ${{ secrets.GPG_KEY }} gpg-passphrase: GPG_KEY_PASSPHRASE + + - name: Checkout BlazingMQ + run: git clone https://github.com/bloomberg/blazingmq + + - name: Get latest BlazingMQ commit SHA + id: get-sha + working-directory: blazingmq + run: echo "blazingmq_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + + - name: Get cached BlazingMQ docker image + id: cache-restore + uses: actions/cache/restore@v3 + with: + path: blazingmq_image.tar.gz + key: ${{ steps.get-sha.outputs.blazingmq_sha }} + + # Pull docker image instead + - name: Build base BlazingMQ docker image + if: steps.cache-restore.outputs.cache-hit != 'true' + working-directory: blazingmq + run: docker compose -f docker/single-node/docker-compose.yaml build + + - name: Load base BlazingMQ docker image from cache + if: steps.cache-restore.outputs.cache-hit == 'true' + run: docker load < blazingmq_image.tar.gz + + - name: Save built BlazingMQ docker image + if: steps.cache-restore.outputs.cache-hit != 'true' + run: docker save bmqbrkr:latest | gzip > blazingmq_image.tar.gz + + - name: Cache built BlazingMQ docker image + id: cache-save + if: steps.cache-restore.outputs.cache-hit != 'true' + uses: actions/cache/save@v3 + with: + path: blazingmq_image.tar.gz + key: ${{ steps.get-sha.outputs.blazingmq_sha }} + + - name: Build IT image + working-directory: bmq-sdk/src/test/docker + run: docker build --tag bmq-broker-java-it --build-arg "image=bmqbrkr:latest" . + - name: 'Publish snapshot to OSSRH' - run: mvn --batch-mode -Possrh -DskipTests=true -Dgpg.keyname=${{ secrets.GPG_KEY_ID }} -Dgpg.passphrase=${{ secrets.GPG_KEY_PASSPHRASE }} -Dmaven.test.skip=true release:prepare release:perform + run: mvn --batch-mode -Possrh -DskipTests=true -Dgpg.keyname=${{ secrets.GPG_KEY_ID }} -Dgpg.passphrase=${{ secrets.GPG_KEY_PASSPHRASE }} -Dit.dockerImage=bmqbrkr:latest release:prepare release:perform env: GPG_KEY_PASSPHRASE: ${{ secrets.GPG_KEY_PASSPHRASE }} OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} From cfed5ac299fe13371ff3622dc28b863bb7bb3818 Mon Sep 17 00:00:00 2001 From: Evgeny Malygin Date: Fri, 27 Oct 2023 16:33:47 +0300 Subject: [PATCH 2/3] CI: pass maven arguments to forked maven process Signed-off-by: Evgeny Malygin --- .github/workflows/publish.yaml | 43 +--------------------------------- 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index e02e54d..82d570e 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -22,50 +22,9 @@ jobs: server-password: OSSRH_PASSWORD gpg-private-key: ${{ secrets.GPG_KEY }} gpg-passphrase: GPG_KEY_PASSPHRASE - - - name: Checkout BlazingMQ - run: git clone https://github.com/bloomberg/blazingmq - - - name: Get latest BlazingMQ commit SHA - id: get-sha - working-directory: blazingmq - run: echo "blazingmq_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - - - name: Get cached BlazingMQ docker image - id: cache-restore - uses: actions/cache/restore@v3 - with: - path: blazingmq_image.tar.gz - key: ${{ steps.get-sha.outputs.blazingmq_sha }} - - # Pull docker image instead - - name: Build base BlazingMQ docker image - if: steps.cache-restore.outputs.cache-hit != 'true' - working-directory: blazingmq - run: docker compose -f docker/single-node/docker-compose.yaml build - - - name: Load base BlazingMQ docker image from cache - if: steps.cache-restore.outputs.cache-hit == 'true' - run: docker load < blazingmq_image.tar.gz - - - name: Save built BlazingMQ docker image - if: steps.cache-restore.outputs.cache-hit != 'true' - run: docker save bmqbrkr:latest | gzip > blazingmq_image.tar.gz - - - name: Cache built BlazingMQ docker image - id: cache-save - if: steps.cache-restore.outputs.cache-hit != 'true' - uses: actions/cache/save@v3 - with: - path: blazingmq_image.tar.gz - key: ${{ steps.get-sha.outputs.blazingmq_sha }} - - - name: Build IT image - working-directory: bmq-sdk/src/test/docker - run: docker build --tag bmq-broker-java-it --build-arg "image=bmqbrkr:latest" . - name: 'Publish snapshot to OSSRH' - run: mvn --batch-mode -Possrh -DskipTests=true -Dgpg.keyname=${{ secrets.GPG_KEY_ID }} -Dgpg.passphrase=${{ secrets.GPG_KEY_PASSPHRASE }} -Dit.dockerImage=bmqbrkr:latest release:prepare release:perform + run: mvn --batch-mode -Possrh -Darguments="-Dmaven.test.skip=true -Dspotbugs.skip=true" -Dgpg.keyname=${{ secrets.GPG_KEY_ID }} -Dgpg.passphrase=${{ secrets.GPG_KEY_PASSPHRASE }} release:prepare release:perform env: GPG_KEY_PASSPHRASE: ${{ secrets.GPG_KEY_PASSPHRASE }} OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} From 58702642860c296ee7a70e3bef21b63cd87ba494 Mon Sep 17 00:00:00 2001 From: Evgeny Malygin Date: Fri, 27 Oct 2023 16:47:13 +0300 Subject: [PATCH 3/3] Update publish.yaml Signed-off-by: Evgeny Malygin --- .github/workflows/publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 82d570e..92215d5 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -24,7 +24,7 @@ jobs: gpg-passphrase: GPG_KEY_PASSPHRASE - name: 'Publish snapshot to OSSRH' - run: mvn --batch-mode -Possrh -Darguments="-Dmaven.test.skip=true -Dspotbugs.skip=true" -Dgpg.keyname=${{ secrets.GPG_KEY_ID }} -Dgpg.passphrase=${{ secrets.GPG_KEY_PASSPHRASE }} release:prepare release:perform + run: mvn --batch-mode -Possrh -Darguments="-Dmaven.test.skip=true -Dspotbugs.skip=true -Dgpg.keyname=${{ secrets.GPG_KEY_ID }} -Dgpg.passphrase=${{ secrets.GPG_KEY_PASSPHRASE }}" release:prepare release:perform env: GPG_KEY_PASSPHRASE: ${{ secrets.GPG_KEY_PASSPHRASE }} OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}