From 791e370b27220736426dc9b50336a82e86c4e969 Mon Sep 17 00:00:00 2001 From: blakep7 Date: Fri, 18 Aug 2023 11:55:31 -0700 Subject: [PATCH] Issue #698 - Feature Request: Build Verification Workflow Signed-off-by: blakep7 --- .github/workflows/build-push.yml | 3 ++ .github/workflows/build-verification.yml | 39 ++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 .github/workflows/build-verification.yml diff --git a/.github/workflows/build-push.yml b/.github/workflows/build-push.yml index 89e34287..d9015245 100644 --- a/.github/workflows/build-push.yml +++ b/.github/workflows/build-push.yml @@ -20,6 +20,9 @@ env: jobs: # This job will build and then push to docker hub build-push: + # Prevent job from running in forks + if: github.repository_owner == 'open_horizon' + # The type of runner the job will run on runs-on: ubuntu-20.04 diff --git a/.github/workflows/build-verification.yml b/.github/workflows/build-verification.yml new file mode 100644 index 00000000..f41af811 --- /dev/null +++ b/.github/workflows/build-verification.yml @@ -0,0 +1,39 @@ +# This workflow is simply to verify that the Anax binaries build successfully, to be used for testing in forks +name: Build Verification + +on: workflow_dispatch + +jobs: + build-verification: + runs-on: ubuntu-20.04 + + env: + BUILD_NUMBER: ${{ github.run_number }} + IMAGE_VERSION: '' + + steps: + # Checkout our Github repo + - name: Checkout Github Repo + uses: actions/checkout@v3 + + # Setup Scala + # Comes from open source action: https://github.com/coursier/setup-action + - name: Setup Scala + uses: coursier/setup-action@v1 + + # Configure version variables + - name: Config Version Variables + run: | + VERSION=$(head -n 1 src/main/resources/version.txt) + echo "IMAGE_VERSION="${VERSION}"" >> $GITHUB_ENV + + # Compile + - name: Compile + run: | + sbt compile + + # Package + - name: Package + run: | + sbt package + docker image ls