From 9a4d547a0653b2e584616e81c2937ca81b07a6bc Mon Sep 17 00:00:00 2001 From: Robert Stein Date: Fri, 11 Nov 2022 09:52:24 +0100 Subject: [PATCH] chore: add binary checks Signed-off-by: Robert Stein --- .github/workflows/binary_checks.yaml | 62 +++++++++++++++++++++++ .github/workflows/dist-build-windows.yaml | 1 + 2 files changed, 63 insertions(+) create mode 100644 .github/workflows/binary_checks.yaml diff --git a/.github/workflows/binary_checks.yaml b/.github/workflows/binary_checks.yaml new file mode 100644 index 00000000..bcc4b152 --- /dev/null +++ b/.github/workflows/binary_checks.yaml @@ -0,0 +1,62 @@ +name: Build and test binaries whether they start + +on: + pull_request: + branches: [ main ] + paths: + - 'client/poetry.lock' + - 'client/pyoxidizer.bzl' + +jobs: + mac_build: + uses: ./.github/workflows/dist-build-mac.yaml + secrets: inherit + + mac_binary_test: + needs: mac_build + runs-on: macos-11 + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Get version + working-directory: client/ + run: | + cat pyproject.toml | grep version -m 1 | awk '{ print "APP_VERSION="substr($3, 2, length($3) -2)}' >> $GITHUB_ENV + - uses: actions/download-artifact@v3 + with: + name: gefyra-${{ env.APP_VERSION }}-darwin-universal + - name: Setup Docker + run: | + brew install docker + docker --version + - name: Sanity run Gefyra + run: | + ls -la + chmod u+x ./gefyra + ./gefyra version + + windows_build: + uses: ./.github/workflows/dist-build-windows.yaml + secrets: inherit + + windows_binary_test: + needs: windows_build + runs-on: windows-2019 + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.9' + - name: Determine App Version + working-directory: client/ + run: | + python ..\.github\scripts\get_version.py + echo "${{ env.APP_VERSION }}" + - uses: actions/download-artifact@v3 + with: + name: gefyra-${{ env.APP_VERSION }}-windows-x86_64 + - name: Sanity run Gefyra + run: | + ./gefyra version diff --git a/.github/workflows/dist-build-windows.yaml b/.github/workflows/dist-build-windows.yaml index 8220082d..ac96b251 100644 --- a/.github/workflows/dist-build-windows.yaml +++ b/.github/workflows/dist-build-windows.yaml @@ -49,6 +49,7 @@ jobs: retention-days: 5 - name: Create release zip working-directory: client/ + if: ${{ github.event.release && github.event.action == 'published' }} run: 7z a -r gefyra-${{ env.APP_VERSION }}-windows-x86_64.zip "dist/" - name: Attach files to release uses: softprops/action-gh-release@v1