From 9bdef429f127e30c544e56064b1e064d65a35d26 Mon Sep 17 00:00:00 2001 From: dhruv Date: Wed, 21 Aug 2024 21:05:39 +0530 Subject: [PATCH 1/5] testing report generation Signed-off-by: dhruv --- .github/workflows/build.yaml | 9 +- .github/workflows/pr-build.yaml | 151 +++++++++++++++++--------------- 2 files changed, 89 insertions(+), 71 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 2ad70d4..8a5938a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -56,7 +56,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v4 with: - java-version: '11' + java-version: '17' distribution: 'semeru' cache: maven @@ -350,6 +350,13 @@ jobs: path: managers ref: ${{ env.BRANCH }} + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'semeru' + cache: maven + - name: Make secrets directory run : | mkdir /home/runner/work/secrets diff --git a/.github/workflows/pr-build.yaml b/.github/workflows/pr-build.yaml index 7e89542..1133b45 100644 --- a/.github/workflows/pr-build.yaml +++ b/.github/workflows/pr-build.yaml @@ -42,7 +42,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v4 with: - java-version: '11' + java-version: '17' distribution: 'semeru' cache: maven @@ -51,40 +51,40 @@ jobs: run: | echo $GITHUB_SHA > ./obr.githash - - name: Make secrets directory - run : | - mkdir /home/runner/work/secrets + # - name: Make secrets directory + # run : | + # mkdir /home/runner/work/secrets - - name: Copy settings.xml - env: - MAVEN_SETTINGS_XML: ${{ secrets.MAVEN_SETTINGS_XML }} - run : | - echo $MAVEN_SETTINGS_XML > /home/runner/work/secrets/settings.xml + # - name: Copy settings.xml + # env: + # MAVEN_SETTINGS_XML: ${{ secrets.MAVEN_SETTINGS_XML }} + # run : | + # echo $MAVEN_SETTINGS_XML > /home/runner/work/secrets/settings.xml - - name: Copy GPG passphrase - env: - GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - run : | - echo $GPG_PASSPHRASE > /home/runner/work/secrets/passphrase.file + # - name: Copy GPG passphrase + # env: + # GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + # run : | + # echo $GPG_PASSPHRASE > /home/runner/work/secrets/passphrase.file - - name: Copy GPG key - env: - GPG_KEY_BASE64: ${{ secrets.GPG_KEY }} - run : | - echo $GPG_KEY_BASE64 | base64 --decode > /home/runner/work/secrets/galasa.gpg + # - name: Copy GPG key + # env: + # GPG_KEY_BASE64: ${{ secrets.GPG_KEY }} + # run : | + # echo $GPG_KEY_BASE64 | base64 --decode > /home/runner/work/secrets/galasa.gpg - - name: Make GPG home directory and change permissions - run: | - mkdir /home/runner/work/gpg - chmod '700' /home/runner/work/gpg + # - name: Make GPG home directory and change permissions + # run: | + # mkdir /home/runner/work/gpg + # chmod '700' /home/runner/work/gpg - - name: Import GPG - run: | - gpg --homedir /home/runner/work/gpg --pinentry-mode loopback --passphrase-file /home/runner/work/secrets/passphrase.file --import /home/runner/work/secrets/galasa.gpg + # - name: Import GPG + # run: | + # gpg --homedir /home/runner/work/gpg --pinentry-mode loopback --passphrase-file /home/runner/work/secrets/passphrase.file --import /home/runner/work/secrets/galasa.gpg - - name: Copy custom settings.xml - run: | - cp /home/runner/work/secrets/settings.xml /home/runner/work/gpg/settings.xml + # - name: Copy custom settings.xml + # run: | + # cp /home/runner/work/secrets/settings.xml /home/runner/work/gpg/settings.xml - name: Generate Galasa BOM run: | @@ -96,13 +96,14 @@ jobs: - name: Build Galasa BOM with maven run: | - mvn -f ${{ github.workspace }}/obr/galasa-bom/pom.xml deploy \ + set -o pipefail + mvn -f ${{ github.workspace }}/obr/galasa-bom/pom.xml deploy --info \ -Dgpg.skip=true \ -Dgalasa.source.repo=https://development.galasa.dev/gh/maven-repo/managers \ -Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \ -Dgalasa.release.repo=file:${{ github.workspace }}/obr/repo \ - --batch-mode --errors --fail-at-end \ - --settings /home/runner/work/gpg/settings.xml + --batch-mode --errors --fail-at-end 2>&1 | tee bom-build.log + # --settings /home/runner/work/gpg/settings.xml - name: Generate Galasa OBR run: | @@ -114,13 +115,14 @@ jobs: - name: Build Galasa OBR with maven run: | - mvn -f ${{ github.workspace }}/obr/dev.galasa.uber.obr/pom.xml deploy \ + set -o pipefail + mvn -f ${{ github.workspace }}/obr/dev.galasa.uber.obr/pom.xml deploy --info \ -Dgpg.skip=true \ -Dgalasa.source.repo=https://development.galasa.dev/gh/maven-repo/managers \ -Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \ -Dgalasa.release.repo=file:${{ github.workspace }}/obr/repo \ - --batch-mode --errors --fail-at-end \ - --settings /home/runner/work/gpg/settings.xml + --batch-mode --errors --fail-at-end 2>&1 | tee obr-build.log + # --settings /home/runner/work/gpg/settings.xml - name: Build OBR image for testing uses: docker/build-push-action@v5 @@ -168,40 +170,40 @@ jobs: distribution: 'semeru' cache: maven - - name: Make secrets directory - run : | - mkdir /home/runner/work/secrets + # - name: Make secrets directory + # run : | + # mkdir /home/runner/work/secrets - - name: Copy settings.xml - env: - MAVEN_SETTINGS_XML: ${{ secrets.MAVEN_SETTINGS_XML }} - run : | - echo $MAVEN_SETTINGS_XML > /home/runner/work/secrets/settings.xml + # - name: Copy settings.xml + # env: + # MAVEN_SETTINGS_XML: ${{ secrets.MAVEN_SETTINGS_XML }} + # run : | + # echo $MAVEN_SETTINGS_XML > /home/runner/work/secrets/settings.xml - - name: Copy GPG passphrase - env: - GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - run : | - echo $GPG_PASSPHRASE > /home/runner/work/secrets/passphrase.file + # - name: Copy GPG passphrase + # env: + # GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + # run : | + # echo $GPG_PASSPHRASE > /home/runner/work/secrets/passphrase.file - - name: Copy GPG key - env: - GPG_KEY_BASE64: ${{ secrets.GPG_KEY }} - run : | - echo $GPG_KEY_BASE64 | base64 --decode > /home/runner/work/secrets/galasa.gpg + # - name: Copy GPG key + # env: + # GPG_KEY_BASE64: ${{ secrets.GPG_KEY }} + # run : | + # echo $GPG_KEY_BASE64 | base64 --decode > /home/runner/work/secrets/galasa.gpg - - name: Make GPG home directory and change permissions - run: | - mkdir /home/runner/work/gpg - chmod '700' /home/runner/work/gpg + # - name: Make GPG home directory and change permissions + # run: | + # mkdir /home/runner/work/gpg + # chmod '700' /home/runner/work/gpg - - name: Import GPG - run: | - gpg --homedir /home/runner/work/gpg --pinentry-mode loopback --passphrase-file /home/runner/work/secrets/passphrase.file --import /home/runner/work/secrets/galasa.gpg + # - name: Import GPG + # run: | + # gpg --homedir /home/runner/work/gpg --pinentry-mode loopback --passphrase-file /home/runner/work/secrets/passphrase.file --import /home/runner/work/secrets/galasa.gpg - - name: Copy custom settings.xml - run: | - cp /home/runner/work/secrets/settings.xml /home/runner/work/gpg/settings.xml + # - name: Copy custom settings.xml + # run: | + # cp /home/runner/work/secrets/settings.xml /home/runner/work/gpg/settings.xml - name: Build Galasa Javadoc run: | @@ -213,13 +215,14 @@ jobs: - name: Build javadoc site using maven run: | - mvn -f ${{ github.workspace }}/obr/javadocs/pom.xml deploy \ + set -o pipefail + mvn -f ${{ github.workspace }}/obr/javadocs/pom.xml deploy --info \ -Dgpg.skip=true \ -Dgalasa.source.repo=https://development.galasa.dev/gh/maven-repo/managers \ -Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \ -Dgalasa.release.repo=file:${{ github.workspace }}/obr/javadocs/docker/repo \ - -Dmaven.javadoc.failOnError=false --batch-mode --errors --fail-at-end \ - --settings /home/runner/work/gpg/settings.xml + -Dmaven.javadoc.failOnError=false --batch-mode --errors --fail-at-end 2>&1 | tee build.log + # --settings /home/runner/work/gpg/settings.xml - name: Build Javadoc site image for testing uses: docker/build-push-action@v5 @@ -243,7 +246,7 @@ jobs: build-obr-generic: name: Build OBR embedded and boot images using galasabld and maven runs-on: ubuntu-latest - needs: [build-obr, build-obr-javadocs] + # needs: [build-obr, build-obr-javadocs] steps: - name: Checkout Code @@ -276,17 +279,25 @@ jobs: - name: Display Galasa OBR generic pom.xml run: | cat ${{ github.workspace }}/obr/obr-generic/pom.xml + + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'semeru' + cache: maven - name: Build Galasa OBR generic pom.xml with maven working-directory: ${{ github.workspace }}/obr/obr-generic run: | - mvn -f pom.xml process-sources \ + set -o pipefail + mvn -f pom.xml process-sources --info \ -Dgpg.skip=true \ -Dgalasa.source.repo=https://development.galasa.dev/gh/maven-repo/obr \ -Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \ dev.galasa:galasa-maven-plugin:0.15.0:obrembedded \ - --batch-mode --errors --fail-at-end \ - --settings settings.xml + --batch-mode --errors --fail-at-end 2>&1 | tee build.log + # --settings settings.xml - name: Build OBR generic image for testing uses: docker/build-push-action@v5 From 76db8cbe3619b76097c3bf21355b9517da00dff3 Mon Sep 17 00:00:00 2001 From: dhruv Date: Thu, 22 Aug 2024 09:48:03 +0530 Subject: [PATCH 2/5] added test report generation/uploading added workflow triggers Signed-off-by: dhruv --- .github/workflows/build.yaml | 68 +++++++++++++-- .github/workflows/pr-build.yaml | 142 ++++++++++++++++---------------- 2 files changed, 129 insertions(+), 81 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8a5938a..c7d3f82 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -110,12 +110,20 @@ jobs: - name: Build Galasa BOM with maven run: | - mvn -f ${{ github.workspace }}/obr/galasa-bom/pom.xml deploy \ + set -o pipefail + mvn -f ${{ github.workspace }}/obr/galasa-bom/pom.xml -X deploy \ -Dgalasa.source.repo=https://development.galasa.dev/${{ env.ARGO_APP_BRANCH }}/maven-repo/managers \ -Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \ -Dgalasa.release.repo=file:${{ github.workspace }}/obr/repo \ --batch-mode --errors --fail-at-end \ - --settings /home/runner/work/gpg/settings.xml + --settings /home/runner/work/gpg/settings.xml 2>&1 | tee galasa-bom-build.log + + - name: Upload Galasa BOM Build Log + if: always() + uses: actions/upload-artifact@v4 + with: + name: galasa-bom-build-log + path: galasa-bom-build.log - name: Generate Galasa OBR run: | @@ -127,12 +135,20 @@ jobs: - name: Build Galasa OBR with maven run: | - mvn -f ${{ github.workspace }}/obr/dev.galasa.uber.obr/pom.xml deploy \ + set -o pipefail + mvn -f ${{ github.workspace }}/obr/dev.galasa.uber.obr/pom.xml -X deploy \ -Dgalasa.source.repo=https://development.galasa.dev/${{ env.ARGO_APP_BRANCH }}/maven-repo/managers \ -Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \ -Dgalasa.release.repo=file:${{ github.workspace }}/obr/repo \ --batch-mode --errors --fail-at-end \ - --settings /home/runner/work/gpg/settings.xml + --settings /home/runner/work/gpg/settings.xml 2>&1 | tee galasa-obr-build.log + + - name: Upload Galasa OBR Build Log + if: always() + uses: actions/upload-artifact@v4 + with: + name: galasa-obr-build-log + path: galasa-obr-build.log - name: Login to Github Container Registry uses: docker/login-action@v3 @@ -252,12 +268,20 @@ jobs: - name: Build javadoc site using maven run: | - mvn -f ${{ github.workspace }}/obr/javadocs/pom.xml deploy \ + set -o pipefail + mvn -f ${{ github.workspace }}/obr/javadocs/pom.xml -X deploy \ -Dgalasa.source.repo=https://development.galasa.dev/${{ env.ARGO_APP_BRANCH }}/maven-repo/managers \ -Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \ -Dgalasa.release.repo=file:${{ github.workspace }}/obr/javadocs/docker/repo \ -Dmaven.javadoc.failOnError=false --batch-mode --errors --fail-at-end \ - --settings /home/runner/work/gpg/settings.xml + --settings /home/runner/work/gpg/settings.xml 2>&1 | tee build.log + + - name: Upload javadoc site Build Log + if: always() + uses: actions/upload-artifact@v4 + with: + name: javadoc-site-build-log + path: build.log - name: Login to Github Container Registry uses: docker/login-action@v3 @@ -403,12 +427,20 @@ jobs: - name: Build Galasa OBR generic pom.xml with maven working-directory: ${{ github.workspace }}/obr/obr-generic run: | - mvn -f pom.xml process-sources \ + set -o pipefail + mvn -f pom.xml -X process-sources \ -Dgalasa.source.repo=https://development.galasa.dev/${{ env.ARGO_APP_BRANCH }}/maven-repo/obr \ -Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \ dev.galasa:galasa-maven-plugin:0.15.0:obrembedded \ --batch-mode --errors --fail-at-end \ - --settings /home/runner/work/gpg/settings.xml + --settings /home/runner/work/gpg/settings.xml 2>&1 | tee build.log + + - name: Upload galasa obr generic Build Log + if: always() + uses: actions/upload-artifact@v4 + with: + name: galasa-obr-generic-build-log + path: build.log - name: Login to Github Container Registry uses: docker/login-action@v3 @@ -479,3 +511,23 @@ jobs: tag=${{ env.BRANCH }} dockerRepository=${{ env.REGISTRY }} platform=x86_64 + + trigger-workflow: + name: Trigger workflow depending upon the branch + needs: [build-obr, build-obr-generic, build-obr-javadocs] + runs-on: ubuntu-latest + + steps: + - name: Triggering helm build (github.ref is main) + if: env.BRANCH == 'main' + env: + GH_TOKEN: ${{ secrets.GALASA_TEAM_GITHUB_TOKEN }} + run: | + gh workflow run build-helm.yaml --repo https://github.com/galasa-dev/automation --ref ${{ env.BRANCH }} + + - name: Triggering cli build (github.ref is not main) + if: env.BRANCH != 'main' + env: + GH_TOKEN: ${{ secrets.GALASA_TEAM_GITHUB_TOKEN }} + run: | + gh workflow run build.yaml --repo https://github.com/galasa-dev/cli --ref ${{ env.BRANCH }} \ No newline at end of file diff --git a/.github/workflows/pr-build.yaml b/.github/workflows/pr-build.yaml index 1133b45..423b95d 100644 --- a/.github/workflows/pr-build.yaml +++ b/.github/workflows/pr-build.yaml @@ -51,40 +51,40 @@ jobs: run: | echo $GITHUB_SHA > ./obr.githash - # - name: Make secrets directory - # run : | - # mkdir /home/runner/work/secrets + - name: Make secrets directory + run : | + mkdir /home/runner/work/secrets - # - name: Copy settings.xml - # env: - # MAVEN_SETTINGS_XML: ${{ secrets.MAVEN_SETTINGS_XML }} - # run : | - # echo $MAVEN_SETTINGS_XML > /home/runner/work/secrets/settings.xml + - name: Copy settings.xml + env: + MAVEN_SETTINGS_XML: ${{ secrets.MAVEN_SETTINGS_XML }} + run : | + echo $MAVEN_SETTINGS_XML > /home/runner/work/secrets/settings.xml - # - name: Copy GPG passphrase - # env: - # GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - # run : | - # echo $GPG_PASSPHRASE > /home/runner/work/secrets/passphrase.file + - name: Copy GPG passphrase + env: + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + run : | + echo $GPG_PASSPHRASE > /home/runner/work/secrets/passphrase.file - # - name: Copy GPG key - # env: - # GPG_KEY_BASE64: ${{ secrets.GPG_KEY }} - # run : | - # echo $GPG_KEY_BASE64 | base64 --decode > /home/runner/work/secrets/galasa.gpg + - name: Copy GPG key + env: + GPG_KEY_BASE64: ${{ secrets.GPG_KEY }} + run : | + echo $GPG_KEY_BASE64 | base64 --decode > /home/runner/work/secrets/galasa.gpg - # - name: Make GPG home directory and change permissions - # run: | - # mkdir /home/runner/work/gpg - # chmod '700' /home/runner/work/gpg + - name: Make GPG home directory and change permissions + run: | + mkdir /home/runner/work/gpg + chmod '700' /home/runner/work/gpg - # - name: Import GPG - # run: | - # gpg --homedir /home/runner/work/gpg --pinentry-mode loopback --passphrase-file /home/runner/work/secrets/passphrase.file --import /home/runner/work/secrets/galasa.gpg + - name: Import GPG + run: | + gpg --homedir /home/runner/work/gpg --pinentry-mode loopback --passphrase-file /home/runner/work/secrets/passphrase.file --import /home/runner/work/secrets/galasa.gpg - # - name: Copy custom settings.xml - # run: | - # cp /home/runner/work/secrets/settings.xml /home/runner/work/gpg/settings.xml + - name: Copy custom settings.xml + run: | + cp /home/runner/work/secrets/settings.xml /home/runner/work/gpg/settings.xml - name: Generate Galasa BOM run: | @@ -96,14 +96,13 @@ jobs: - name: Build Galasa BOM with maven run: | - set -o pipefail - mvn -f ${{ github.workspace }}/obr/galasa-bom/pom.xml deploy --info \ + mvn -f ${{ github.workspace }}/obr/galasa-bom/pom.xml -X deploy \ -Dgpg.skip=true \ -Dgalasa.source.repo=https://development.galasa.dev/gh/maven-repo/managers \ -Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \ -Dgalasa.release.repo=file:${{ github.workspace }}/obr/repo \ - --batch-mode --errors --fail-at-end 2>&1 | tee bom-build.log - # --settings /home/runner/work/gpg/settings.xml + --batch-mode --errors --fail-at-end \ + --settings /home/runner/work/gpg/settings.xml - name: Generate Galasa OBR run: | @@ -115,14 +114,13 @@ jobs: - name: Build Galasa OBR with maven run: | - set -o pipefail - mvn -f ${{ github.workspace }}/obr/dev.galasa.uber.obr/pom.xml deploy --info \ + mvn -f ${{ github.workspace }}/obr/dev.galasa.uber.obr/pom.xml -X deploy \ -Dgpg.skip=true \ -Dgalasa.source.repo=https://development.galasa.dev/gh/maven-repo/managers \ -Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \ -Dgalasa.release.repo=file:${{ github.workspace }}/obr/repo \ - --batch-mode --errors --fail-at-end 2>&1 | tee obr-build.log - # --settings /home/runner/work/gpg/settings.xml + --batch-mode --errors --fail-at-end \ + --settings /home/runner/work/gpg/settings.xml - name: Build OBR image for testing uses: docker/build-push-action@v5 @@ -170,40 +168,40 @@ jobs: distribution: 'semeru' cache: maven - # - name: Make secrets directory - # run : | - # mkdir /home/runner/work/secrets + - name: Make secrets directory + run : | + mkdir /home/runner/work/secrets - # - name: Copy settings.xml - # env: - # MAVEN_SETTINGS_XML: ${{ secrets.MAVEN_SETTINGS_XML }} - # run : | - # echo $MAVEN_SETTINGS_XML > /home/runner/work/secrets/settings.xml + - name: Copy settings.xml + env: + MAVEN_SETTINGS_XML: ${{ secrets.MAVEN_SETTINGS_XML }} + run : | + echo $MAVEN_SETTINGS_XML > /home/runner/work/secrets/settings.xml - # - name: Copy GPG passphrase - # env: - # GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - # run : | - # echo $GPG_PASSPHRASE > /home/runner/work/secrets/passphrase.file + - name: Copy GPG passphrase + env: + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + run : | + echo $GPG_PASSPHRASE > /home/runner/work/secrets/passphrase.file - # - name: Copy GPG key - # env: - # GPG_KEY_BASE64: ${{ secrets.GPG_KEY }} - # run : | - # echo $GPG_KEY_BASE64 | base64 --decode > /home/runner/work/secrets/galasa.gpg + - name: Copy GPG key + env: + GPG_KEY_BASE64: ${{ secrets.GPG_KEY }} + run : | + echo $GPG_KEY_BASE64 | base64 --decode > /home/runner/work/secrets/galasa.gpg - # - name: Make GPG home directory and change permissions - # run: | - # mkdir /home/runner/work/gpg - # chmod '700' /home/runner/work/gpg + - name: Make GPG home directory and change permissions + run: | + mkdir /home/runner/work/gpg + chmod '700' /home/runner/work/gpg - # - name: Import GPG - # run: | - # gpg --homedir /home/runner/work/gpg --pinentry-mode loopback --passphrase-file /home/runner/work/secrets/passphrase.file --import /home/runner/work/secrets/galasa.gpg + - name: Import GPG + run: | + gpg --homedir /home/runner/work/gpg --pinentry-mode loopback --passphrase-file /home/runner/work/secrets/passphrase.file --import /home/runner/work/secrets/galasa.gpg - # - name: Copy custom settings.xml - # run: | - # cp /home/runner/work/secrets/settings.xml /home/runner/work/gpg/settings.xml + - name: Copy custom settings.xml + run: | + cp /home/runner/work/secrets/settings.xml /home/runner/work/gpg/settings.xml - name: Build Galasa Javadoc run: | @@ -215,14 +213,13 @@ jobs: - name: Build javadoc site using maven run: | - set -o pipefail - mvn -f ${{ github.workspace }}/obr/javadocs/pom.xml deploy --info \ + mvn -f ${{ github.workspace }}/obr/javadocs/pom.xml -X deploy \ -Dgpg.skip=true \ -Dgalasa.source.repo=https://development.galasa.dev/gh/maven-repo/managers \ -Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \ -Dgalasa.release.repo=file:${{ github.workspace }}/obr/javadocs/docker/repo \ - -Dmaven.javadoc.failOnError=false --batch-mode --errors --fail-at-end 2>&1 | tee build.log - # --settings /home/runner/work/gpg/settings.xml + -Dmaven.javadoc.failOnError=false --batch-mode --errors --fail-at-end \ + --settings /home/runner/work/gpg/settings.xml - name: Build Javadoc site image for testing uses: docker/build-push-action@v5 @@ -246,7 +243,7 @@ jobs: build-obr-generic: name: Build OBR embedded and boot images using galasabld and maven runs-on: ubuntu-latest - # needs: [build-obr, build-obr-javadocs] + needs: [build-obr, build-obr-javadocs] steps: - name: Checkout Code @@ -290,14 +287,13 @@ jobs: - name: Build Galasa OBR generic pom.xml with maven working-directory: ${{ github.workspace }}/obr/obr-generic run: | - set -o pipefail - mvn -f pom.xml process-sources --info \ + mvn -f pom.xml -X process-sources \ -Dgpg.skip=true \ -Dgalasa.source.repo=https://development.galasa.dev/gh/maven-repo/obr \ -Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \ dev.galasa:galasa-maven-plugin:0.15.0:obrembedded \ - --batch-mode --errors --fail-at-end 2>&1 | tee build.log - # --settings settings.xml + --batch-mode --errors --fail-at-end \ + --settings settings.xml - name: Build OBR generic image for testing uses: docker/build-push-action@v5 From c816b9e72d9db4b33f62f3bc46e05df681447e61 Mon Sep 17 00:00:00 2001 From: dhruv Date: Thu, 22 Aug 2024 09:52:27 +0530 Subject: [PATCH 3/5] fixed java version Signed-off-by: dhruv --- .github/workflows/build.yaml | 2 +- .github/workflows/pr-build.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c7d3f82..74d1098 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -219,7 +219,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v4 with: - java-version: '18' + java-version: '17' distribution: 'semeru' cache: maven diff --git a/.github/workflows/pr-build.yaml b/.github/workflows/pr-build.yaml index 423b95d..7ec5a83 100644 --- a/.github/workflows/pr-build.yaml +++ b/.github/workflows/pr-build.yaml @@ -164,7 +164,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v4 with: - java-version: '18' + java-version: '17' distribution: 'semeru' cache: maven From c0315071b8da639117b3c8a544895dde3642c96e Mon Sep 17 00:00:00 2001 From: dhruv Date: Thu, 22 Aug 2024 19:02:00 +0530 Subject: [PATCH 4/5] made required changes Signed-off-by: dhruv --- .github/workflows/build.yaml | 24 ++++++++++---------- .github/workflows/pr-build.yaml | 40 +++++++++++++++++++++++++++++---- 2 files changed, 48 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 74d1098..2549b84 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -119,7 +119,7 @@ jobs: --settings /home/runner/work/gpg/settings.xml 2>&1 | tee galasa-bom-build.log - name: Upload Galasa BOM Build Log - if: always() + if: failure() uses: actions/upload-artifact@v4 with: name: galasa-bom-build-log @@ -144,7 +144,7 @@ jobs: --settings /home/runner/work/gpg/settings.xml 2>&1 | tee galasa-obr-build.log - name: Upload Galasa OBR Build Log - if: always() + if: failure() uses: actions/upload-artifact@v4 with: name: galasa-obr-build-log @@ -277,7 +277,7 @@ jobs: --settings /home/runner/work/gpg/settings.xml 2>&1 | tee build.log - name: Upload javadoc site Build Log - if: always() + if: failure() uses: actions/upload-artifact@v4 with: name: javadoc-site-build-log @@ -436,7 +436,7 @@ jobs: --settings /home/runner/work/gpg/settings.xml 2>&1 | tee build.log - name: Upload galasa obr generic Build Log - if: always() + if: failure() uses: actions/upload-artifact@v4 with: name: galasa-obr-generic-build-log @@ -518,16 +518,16 @@ jobs: runs-on: ubuntu-latest steps: - - name: Triggering helm build (github.ref is main) - if: env.BRANCH == 'main' - env: - GH_TOKEN: ${{ secrets.GALASA_TEAM_GITHUB_TOKEN }} - run: | - gh workflow run build-helm.yaml --repo https://github.com/galasa-dev/automation --ref ${{ env.BRANCH }} + # - name: Triggering helm build (github.ref is main) + # if: ${{env.BRANCH}} == 'main' + # env: + # GH_TOKEN: ${{ secrets.GALASA_TEAM_GITHUB_TOKEN }} + # run: | + # gh workflow run build-helm.yaml --repo https://github.com/galasa-dev/automation --ref ${{ env.BRANCH }} - name: Triggering cli build (github.ref is not main) - if: env.BRANCH != 'main' + if: ${{env.BRANCH}} != 'main' env: GH_TOKEN: ${{ secrets.GALASA_TEAM_GITHUB_TOKEN }} run: | - gh workflow run build.yaml --repo https://github.com/galasa-dev/cli --ref ${{ env.BRANCH }} \ No newline at end of file + gh workflow run build.yml --repo https://github.com/galasa-dev/cli --ref ${{ env.BRANCH }} \ No newline at end of file diff --git a/.github/workflows/pr-build.yaml b/.github/workflows/pr-build.yaml index 7ec5a83..1809695 100644 --- a/.github/workflows/pr-build.yaml +++ b/.github/workflows/pr-build.yaml @@ -96,13 +96,21 @@ jobs: - name: Build Galasa BOM with maven run: | + set -o pipefail mvn -f ${{ github.workspace }}/obr/galasa-bom/pom.xml -X deploy \ -Dgpg.skip=true \ -Dgalasa.source.repo=https://development.galasa.dev/gh/maven-repo/managers \ -Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \ -Dgalasa.release.repo=file:${{ github.workspace }}/obr/repo \ --batch-mode --errors --fail-at-end \ - --settings /home/runner/work/gpg/settings.xml + --settings /home/runner/work/gpg/settings.xml 2>&1 | tee galasa-bom-build.log + + - name: Upload Galasa BOM Build Log + if: failure() + uses: actions/upload-artifact@v4 + with: + name: galasa-bom-build-log + path: galasa-bom-build.log - name: Generate Galasa OBR run: | @@ -114,13 +122,21 @@ jobs: - name: Build Galasa OBR with maven run: | + set -o pipefail mvn -f ${{ github.workspace }}/obr/dev.galasa.uber.obr/pom.xml -X deploy \ -Dgpg.skip=true \ -Dgalasa.source.repo=https://development.galasa.dev/gh/maven-repo/managers \ -Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \ -Dgalasa.release.repo=file:${{ github.workspace }}/obr/repo \ --batch-mode --errors --fail-at-end \ - --settings /home/runner/work/gpg/settings.xml + --settings /home/runner/work/gpg/settings.xml 2>&1 | tee galasa-obr-build.log + + - name: Upload Galasa OBR Build Log + if: failure() + uses: actions/upload-artifact@v4 + with: + name: galasa-obr-build-log + path: galasa-obr-build.log - name: Build OBR image for testing uses: docker/build-push-action@v5 @@ -213,13 +229,21 @@ jobs: - name: Build javadoc site using maven run: | + set -o pipefail mvn -f ${{ github.workspace }}/obr/javadocs/pom.xml -X deploy \ -Dgpg.skip=true \ -Dgalasa.source.repo=https://development.galasa.dev/gh/maven-repo/managers \ -Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \ -Dgalasa.release.repo=file:${{ github.workspace }}/obr/javadocs/docker/repo \ -Dmaven.javadoc.failOnError=false --batch-mode --errors --fail-at-end \ - --settings /home/runner/work/gpg/settings.xml + --settings /home/runner/work/gpg/settings.xml 2>&1 | tee build.log + + - name: Upload javadoc site Build Log + if: failure() + uses: actions/upload-artifact@v4 + with: + name: javadoc-site-build-log + path: build.log - name: Build Javadoc site image for testing uses: docker/build-push-action@v5 @@ -287,13 +311,21 @@ jobs: - name: Build Galasa OBR generic pom.xml with maven working-directory: ${{ github.workspace }}/obr/obr-generic run: | + set -o pipefail mvn -f pom.xml -X process-sources \ -Dgpg.skip=true \ -Dgalasa.source.repo=https://development.galasa.dev/gh/maven-repo/obr \ -Dgalasa.central.repo=https://repo.maven.apache.org/maven2/ \ dev.galasa:galasa-maven-plugin:0.15.0:obrembedded \ --batch-mode --errors --fail-at-end \ - --settings settings.xml + --settings settings.xml 2>&1 | build.log + + - name: Upload galasa obr generic Build Log + if: failure() + uses: actions/upload-artifact@v4 + with: + name: galasa-obr-generic-build-log + path: build.log - name: Build OBR generic image for testing uses: docker/build-push-action@v5 From 5c94f9ae99a2cc026f18af842add1f414ed5ee04 Mon Sep 17 00:00:00 2001 From: dhruv Date: Thu, 22 Aug 2024 19:07:13 +0530 Subject: [PATCH 5/5] made required changes Signed-off-by: dhruv --- .github/workflows/build.yaml | 4 ++++ .github/workflows/pr-build.yaml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 2549b84..534cc0f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -124,6 +124,7 @@ jobs: with: name: galasa-bom-build-log path: galasa-bom-build.log + retention-days: 7 - name: Generate Galasa OBR run: | @@ -149,6 +150,7 @@ jobs: with: name: galasa-obr-build-log path: galasa-obr-build.log + retention-days: 7 - name: Login to Github Container Registry uses: docker/login-action@v3 @@ -282,6 +284,7 @@ jobs: with: name: javadoc-site-build-log path: build.log + retention-days: 7 - name: Login to Github Container Registry uses: docker/login-action@v3 @@ -441,6 +444,7 @@ jobs: with: name: galasa-obr-generic-build-log path: build.log + retention-days: 7 - name: Login to Github Container Registry uses: docker/login-action@v3 diff --git a/.github/workflows/pr-build.yaml b/.github/workflows/pr-build.yaml index 1809695..27fe519 100644 --- a/.github/workflows/pr-build.yaml +++ b/.github/workflows/pr-build.yaml @@ -111,6 +111,7 @@ jobs: with: name: galasa-bom-build-log path: galasa-bom-build.log + retention-days: 7 - name: Generate Galasa OBR run: | @@ -137,6 +138,7 @@ jobs: with: name: galasa-obr-build-log path: galasa-obr-build.log + retention-days: 7 - name: Build OBR image for testing uses: docker/build-push-action@v5 @@ -244,6 +246,7 @@ jobs: with: name: javadoc-site-build-log path: build.log + retention-days: 7 - name: Build Javadoc site image for testing uses: docker/build-push-action@v5 @@ -326,6 +329,7 @@ jobs: with: name: galasa-obr-generic-build-log path: build.log + retention-days: 7 - name: Build OBR generic image for testing uses: docker/build-push-action@v5