From bb8d4fdb777d79df7252b21fb06b83a5d83f2fe0 Mon Sep 17 00:00:00 2001 From: Jade Carino <65225359+jadecarino@users.noreply.github.com> Date: Tue, 16 Jul 2024 15:53:32 +0100 Subject: [PATCH] Iss1719 (#59) * Build buildutils executable from this workflow now too Signed-off-by: Jade Carino * Fix order condition Signed-off-by: Jade Carino * Run make again in the third job Signed-off-by: Jade Carino * Fixed mistake Signed-off-by: Jade Carino * Add PR num to end of binary name Signed-off-by: Jade Carino --------- Signed-off-by: Jade Carino --- .github/workflows/build.yaml | 19 ++++-- .github/workflows/pr-build.yaml | 96 ++++++++++++++++++------------- dockerfiles/dockerfile.buildutils | 2 +- 3 files changed, 72 insertions(+), 45 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 706b225..9482e57 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -58,7 +58,7 @@ jobs: run: | docker run --rm galasabld-amd64:${{ env.IMAGE_TAG }} - - name: Build and push galsabld image + - name: Build and push galasabld image uses: docker/build-push-action@v5 with: context: . @@ -74,7 +74,6 @@ jobs: name: galasabld-${{matrix.config.name}}-${{matrix.config.arch}} path: bin/galasabld-${{matrix.config.name}}-${{matrix.config.arch}} - build-push-galasabld-ibm: name: Build and push galasabld-ibm artefact runs-on: ubuntu-latest @@ -142,7 +141,7 @@ jobs: - name: Build openapi2beans using the Makefile run: | - make all -C openapi2beans/ + make all -C openapi2beans - name: Login to GitHub Container Registry uses: docker/login-action@v3 @@ -189,12 +188,24 @@ jobs: build-push-buildutils-executables: name: Build and push buildutils repository executables runs-on: ubuntu-latest - needs: [build-push-galasabld, build-push-openapi2beans] steps: - name: Checkout code uses: actions/checkout@v4 + - name: Setup up Go + uses: actions/setup-go@v5 + with: + go-version: 1.22 + + - name: Build galasabld using the Makefile + run: | + make all + + - name: Build openapi2beans using the Makefile + run: | + make all -C openapi2beans + - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: diff --git a/.github/workflows/pr-build.yaml b/.github/workflows/pr-build.yaml index 3d989e6..204de89 100644 --- a/.github/workflows/pr-build.yaml +++ b/.github/workflows/pr-build.yaml @@ -8,48 +8,64 @@ env: IMAGE_TAG: ${{ github.event.number }} jobs: - build-galasabld: - name: Build galasabld - runs-on: ubuntu-latest + build-upload-galasabld: + name: Build galasabld + runs-on: ubuntu-latest + strategy: + matrix: + config: [{'name':'linux','arch':'amd64'},{'name':'windows','arch':'amd64'},{'name':'darwin','arch':'amd64'},{'name':'darwin','arch':'arm64'},{'name':'linux','arch':'s390x'}] - steps: - - name: Checkout code - uses: actions/checkout@v4 + steps: + - name: Checkout code + uses: actions/checkout@v4 - - name: Setup up Go - uses: actions/setup-go@v5 - with: - go-version: 1.22 - - - name: Build galasabld using the Makefile - run: | - make all - - - name: Build and test galasabld image - run: | - docker build -t galasabld:${{env.IMAGE_TAG}} --build-arg platform=linux-amd64 -f dockerfiles/galasabld/dockerfile.galasabld . - docker run --rm galasabld:${{env.IMAGE_TAG}} + - name: Setup up Go + uses: actions/setup-go@v5 + with: + go-version: 1.22 + + - name: Build galasabld using the Makefile + run: | + make all + + - name: Build and test galasabld image + run: | + docker build -t galasabld:${{env.IMAGE_TAG}} --build-arg platform=linux-amd64 -f dockerfiles/galasabld/dockerfile.galasabld . + docker run --rm galasabld:${{env.IMAGE_TAG}} + - name: Push galasabld executables + uses: actions/upload-artifact@v4 + with: + name: galasabld-${{matrix.config.name}}-${{matrix.config.arch}}-${{ github.event.number }} + path: bin/galasabld-${{matrix.config.name}}-${{matrix.config.arch}} + build-upload-openapi2beans: + name: Build openapi2beans + runs-on: ubuntu-latest + strategy: + matrix: + config: [{'name':'darwin','arch':'arm64'},{'name':'darwin','arch':'x86_64'},{'name':'linux','arch':'x86_64'}] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup up Go + uses: actions/setup-go@v5 + with: + go-version: 1.22 + + - name: Build and test openapi2beans using the Makefile + run: | + make all -C openapi2beans/ + + - name: Build and test openapi2beans image + run: | + docker build -t openapi2beans:${{env.IMAGE_TAG}} --build-arg platform=linux-x86_64 -f dockerfiles/openapi2beans/dockerfile.openapi2beans . + docker run --rm openapi2beans:${{env.IMAGE_TAG}} - build-openapi2beans: - name: Build openapi2beans - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup up Go - uses: actions/setup-go@v5 - with: - go-version: 1.22 - - - name: Build and test openapi2beans using the Makefile - run: | - make all -C openapi2beans/ - - - name: Build and test openapi2beans image - run: | - docker build -t openapi2beans:${{env.IMAGE_TAG}} --build-arg platform=linux-x86_64 -f dockerfiles/openapi2beans/dockerfile.openapi2beans . - docker run --rm openapi2beans:${{env.IMAGE_TAG}} + - name: Push openapi2beans executables + uses: actions/upload-artifact@v4 + with: + name: openapi2beans-${{matrix.config.name}}-${{matrix.config.arch}}-${{ github.event.number }} + path: openapi2beans/bin/openapi2beans-${{matrix.config.name}}-${{matrix.config.arch}} diff --git a/dockerfiles/dockerfile.buildutils b/dockerfiles/dockerfile.buildutils index 2ca3e63..b8045cc 100644 --- a/dockerfiles/dockerfile.buildutils +++ b/dockerfiles/dockerfile.buildutils @@ -1,7 +1,7 @@ FROM harbor.galasa.dev/docker_proxy_cache/library/httpd:2.4.59 RUN rm -v /usr/local/apache2/htdocs/* -COPY /dockerfiles/httpdconf/httpd.conf /usr/local/apache2/conf/httpd.conf +COPY dockerfiles/httpdconf/httpd.conf /usr/local/apache2/conf/httpd.conf COPY bin/ /usr/local/apache2/htdocs/ COPY openapi2beans/bin/ /usr/local/apache2/htdocs/ \ No newline at end of file