diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 2ad70d4..534cc0f 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 @@ -110,12 +110,21 @@ 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: failure() + uses: actions/upload-artifact@v4 + with: + name: galasa-bom-build-log + path: galasa-bom-build.log + retention-days: 7 - name: Generate Galasa OBR run: | @@ -127,12 +136,21 @@ 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: failure() + uses: actions/upload-artifact@v4 + 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 @@ -203,7 +221,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v4 with: - java-version: '18' + java-version: '17' distribution: 'semeru' cache: maven @@ -252,12 +270,21 @@ 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: failure() + uses: actions/upload-artifact@v4 + with: + name: javadoc-site-build-log + path: build.log + retention-days: 7 - name: Login to Github Container Registry uses: docker/login-action@v3 @@ -350,6 +377,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 @@ -396,12 +430,21 @@ 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: failure() + uses: actions/upload-artifact@v4 + with: + name: galasa-obr-generic-build-log + path: build.log + retention-days: 7 - name: Login to Github Container Registry uses: docker/login-action@v3 @@ -472,3 +515,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.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 7e89542..27fe519 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 @@ -96,13 +96,22 @@ 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 \ -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 + retention-days: 7 - name: Generate Galasa OBR run: | @@ -114,13 +123,22 @@ 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 \ -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 + retention-days: 7 - name: Build OBR image for testing uses: docker/build-push-action@v5 @@ -164,7 +182,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v4 with: - java-version: '18' + java-version: '17' distribution: 'semeru' cache: maven @@ -213,13 +231,22 @@ 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 \ -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 + retention-days: 7 - name: Build Javadoc site image for testing uses: docker/build-push-action@v5 @@ -276,17 +303,33 @@ 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 -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 + retention-days: 7 - name: Build OBR generic image for testing uses: docker/build-push-action@v5