From f038c1c146bbb4b1c8027739b8f71d0284bdfb40 Mon Sep 17 00:00:00 2001 From: blakep7 Date: Fri, 18 Aug 2023 12:19:50 -0700 Subject: [PATCH 1/2] Issue #44 - Feature Request: Build Verification Workflow Signed-off-by: blakep7 --- .github/workflows/build-push.yml | 5 ++- .github/workflows/build-verification.yml | 42 ++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-verification.yml diff --git a/.github/workflows/build-push.yml b/.github/workflows/build-push.yml index 5fd099c..632fdfd 100644 --- a/.github/workflows/build-push.yml +++ b/.github/workflows/build-push.yml @@ -20,7 +20,10 @@ env: jobs: # Build FDO-Support and pushes it to Dockerhub build-push: - runs-on: ubuntu-latest + # Prevent this action from running in forks + if: github.repository_owner == 'open-horizon' + + runs-on: ubuntu-20.04 # Environment variables available to all steps env: diff --git a/.github/workflows/build-verification.yml b/.github/workflows/build-verification.yml new file mode 100644 index 0000000..f7dfd89 --- /dev/null +++ b/.github/workflows/build-verification.yml @@ -0,0 +1,42 @@ +name: Build Verification + +on: workflow_dispatch + +jobs: + build-verification: + + runs-on: ubuntu-20.04 + + env: + REPO_DIR: ${{ github.workspace }}/go/src/github.com/${{ github.repository }} + + steps: + # Checkout our Github repo + - name: Checkout Github Repo + uses: actions/checkout@v3 + with: + path: go/src/github.com/${{ github.repository }} + + # Prepare the environment + - name: Set up golang 1.19 + uses: actions/setup-go@v2 + with: + go-version: '1.19' + check-latest: true + + # Configure version variables for later steps, stored in our workflow env. variables + - name: Config Version Variables + id: config-version + run: | + cd ${REPO_DIR} + echo "VERSION=$(sed -n 's/export VERSION ?= //p' Makefile | cut -d '$' -f 1)" >> $GITHUB_OUTPUT + + # Compile FDO-Support and Build Docker Images + - name: Compile and Build Docker Images + run: | + cd ${REPO_DIR} + make clean + make + docker image ls + env: + VERSION: '${{ steps.config-version.outputs.VERSION }}-${{ github.run_number }}' \ No newline at end of file From a6fd1a5353f8d5648318f307a2c2c50861ac0aa7 Mon Sep 17 00:00:00 2001 From: Oleksandr Mordyk Date: Mon, 2 Jun 2025 05:00:23 -0700 Subject: [PATCH 2/2] Update "Build Verification" dependency to the latest version Signed-off-by: Oleksandr Mordyk --- .github/workflows/build-push.yml | 10 +++---- .github/workflows/build-verification.yml | 37 ++++++++++++------------ 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build-push.yml b/.github/workflows/build-push.yml index 632fdfd..5e9e2df 100644 --- a/.github/workflows/build-push.yml +++ b/.github/workflows/build-push.yml @@ -23,7 +23,7 @@ jobs: # Prevent this action from running in forks if: github.repository_owner == 'open-horizon' - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest # Environment variables available to all steps env: @@ -89,15 +89,15 @@ jobs: # Checkout our Github repo - name: Checkout Github Repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: go/src/github.com/${{ github.repository }} # Prepare the environment - - name: Set up golang 1.21 - uses: actions/setup-go@v2 + - name: Set up golang 1.23 + uses: actions/setup-go@v5 with: - go-version: '1.21' + go-version: '1.23' check-latest: true # Configure version variables for later steps, stored in our workflow env. variables diff --git a/.github/workflows/build-verification.yml b/.github/workflows/build-verification.yml index f7dfd89..b1c6cb1 100644 --- a/.github/workflows/build-verification.yml +++ b/.github/workflows/build-verification.yml @@ -1,42 +1,43 @@ name: Build Verification -on: workflow_dispatch +on: + push: + branches-ignore: + - main + workflow_dispatch: jobs: build-verification: - - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest env: - REPO_DIR: ${{ github.workspace }}/go/src/github.com/${{ github.repository }} + GOPATH: ${{ github.workspace }}/go + REPO_DIR: ${{ github.workspace }}/go/src/github.com/${{ github.repository_owner }}/${{ github.event.repository.name }} steps: - # Checkout our Github repo - - name: Checkout Github Repo - uses: actions/checkout@v3 + - name: Checkout GitHub Repo + uses: actions/checkout@v4 with: - path: go/src/github.com/${{ github.repository }} + path: go/src/github.com/${{ github.repository_owner }}/${{ github.event.repository.name }} - # Prepare the environment - - name: Set up golang 1.19 - uses: actions/setup-go@v2 + - name: Set up Go 1.23 + uses: actions/setup-go@v5 with: - go-version: '1.19' + go-version: '1.23' check-latest: true - # Configure version variables for later steps, stored in our workflow env. variables - name: Config Version Variables id: config-version run: | - cd ${REPO_DIR} - echo "VERSION=$(sed -n 's/export VERSION ?= //p' Makefile | cut -d '$' -f 1)" >> $GITHUB_OUTPUT + cd "$REPO_DIR" + VERSION=$(sed -n 's/export VERSION ?= //p' Makefile | cut -d '$' -f 1) + echo "VERSION=$VERSION" >> $GITHUB_OUTPUT - # Compile FDO-Support and Build Docker Images - name: Compile and Build Docker Images run: | - cd ${REPO_DIR} + cd "$REPO_DIR" make clean make docker image ls env: - VERSION: '${{ steps.config-version.outputs.VERSION }}-${{ github.run_number }}' \ No newline at end of file + VERSION: '${{ steps.config-version.outputs.VERSION }}-${{ github.run_number }}'