From 0dfeaa9e73a4bf9a8f01a85686d248d1df45b3d6 Mon Sep 17 00:00:00 2001 From: Kevin Li Date: Tue, 16 May 2023 12:52:43 -0700 Subject: [PATCH] ci: Fix brew/aws command and Rosetta tests (#403) Issue #, if available: *Description of changes:* Fixed the missing configuration step for brew/aws command and Rosetta tests in release related github action. *Testing done:* Have run the action on this branch - [X] I've reviewed the guidance in CONTRIBUTING.md #### License Acceptance By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Signed-off-by: Kevin Li --- .github/workflows/release-homebrew.yaml | 19 +++++++++++++++++-- .github/workflows/release-installer.yaml | 8 ++++++++ .github/workflows/upload-build-to-s3.yaml | 4 +++- .../upload-installer-to-release.yaml | 1 + 4 files changed, 29 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-homebrew.yaml b/.github/workflows/release-homebrew.yaml index 8ebf4b15f..8873fb16d 100644 --- a/.github/workflows/release-homebrew.yaml +++ b/.github/workflows/release-homebrew.yaml @@ -74,6 +74,7 @@ jobs: fi cd $(brew --repo homebrew/cask) brew uninstall --cask ./Casks/finch.rb || true + shell: zsh {0} - name: Set up Homebrew id: set-up-homebrew uses: Homebrew/actions/setup-homebrew@master @@ -86,16 +87,21 @@ jobs: cd $(brew --repo homebrew/cask) echo "Update the local Finch cask with version $FINCH_VERSION" brew bump-cask-pr --write-only -f --version=$FINCH_VERSION finch + shell: zsh {0} - name: Silently install run: | export HOMEBREW_NO_INSTALL_FROM_API=1 cd $(brew --repo homebrew/cask) brew install --cask ./Casks/finch.rb + shell: zsh {0} + - name: Install Rosetta 2 + run: echo "A" | softwareupdate --install-rosetta || true - name: Build project run: | brew install go lz4 automake autoconf libtool export PATH="/opt/homebrew/opt/libtool/libexec/gnubin:$PATH" make + shell: zsh {0} - name: Multiple instances of Finch test run: | # start two Finch VM instances @@ -135,6 +141,7 @@ jobs: # that caused the VM initialization failure in the e2e test. # Example workflow run https://github.com/runfinch/finch/actions/runs/4367457552/jobs/7638794529 brew reinstall --cask ./Casks/finch.rb + shell: zsh {0} - name: Run e2e tests run: INSTALLED=true make test-e2e - name: Silently uninstall @@ -146,7 +153,7 @@ jobs: echo ERROR: Finch is not uninstalled exit 1 fi - + shell: zsh {0} macos-amd64-test-installer: needs: get-latest-tag strategy: @@ -186,6 +193,7 @@ jobs: fi cd $(brew --repo homebrew/cask) brew uninstall --cask ./Casks/finch.rb || true + shell: zsh {0} - name: Set up Homebrew id: set-up-homebrew uses: Homebrew/actions/setup-homebrew@master @@ -196,16 +204,21 @@ jobs: cd $(brew --repo homebrew/cask) echo "Update the local Finch cask with version $FINCH_VERSION" brew bump-cask-pr --write-only -f --version=$FINCH_VERSION finch + shell: zsh {0} - name: Silently install run: | export HOMEBREW_NO_INSTALL_FROM_API=1 cd $(brew --repo homebrew/cask) brew install --cask ./Casks/finch.rb + shell: zsh {0} + - name: Install Rosetta 2 + run: echo "A" | softwareupdate --install-rosetta || true - name: Build project run: | brew install go lz4 automake autoconf libtool export PATH="/opt/homebrew/opt/libtool/libexec/gnubin:$PATH" make + shell: zsh {0} - name: Multiple instances of Finch test run: | # start two Finch VM instances @@ -242,6 +255,7 @@ jobs: export HOMEBREW_NO_INSTALL_FROM_API=1 cd $(brew --repo homebrew/cask) brew reinstall --cask ./Casks/finch.rb + shell: zsh {0} - name: Run e2e tests run: INSTALLED=true make test-e2e - name: Silently uninstall @@ -253,7 +267,7 @@ jobs: echo ERROR: Finch is not uninstalled exit 1 fi - + shell: zsh {0} pr-to-homebrew: needs: [get-latest-tag, macos-arm64-test-installer, macos-amd64-test-installer] runs-on: macos-latest @@ -263,6 +277,7 @@ jobs: uses: Homebrew/actions/setup-homebrew@master - name: Open a pull request to homebrwe-cask run: brew bump-cask-pr --version=${FINCH_VERSION} finch + shell: zsh {0} env: FINCH_VERSION: ${{ needs.get-latest-tag.outputs.version }} HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} diff --git a/.github/workflows/release-installer.yaml b/.github/workflows/release-installer.yaml index 51f7b6b7c..75edffbe9 100644 --- a/.github/workflows/release-installer.yaml +++ b/.github/workflows/release-installer.yaml @@ -70,13 +70,17 @@ jobs: - name: Download from S3 run: | aws s3 cp s3://${{ secrets.INSTALLER_PRIVATE_BUCKET_NAME }}/Finch-${GITHUB_REF_NAME}-aarch64.pkg Finch-${GITHUB_REF_NAME}-aarch64.pkg + shell: zsh {0} - name: Silently install run: sudo installer -pkg Finch-${GITHUB_REF_NAME}-aarch64.pkg -target / + - name: Install Rosetta 2 + run: echo "A" | softwareupdate --install-rosetta || true - name: Build project run: | brew install go lz4 automake autoconf libtool export PATH="/opt/homebrew/opt/libtool/libexec/gnubin:$PATH" make + shell: zsh {0} - name: Multiple instances of Finch test run: | # start two Finch VM instances @@ -167,14 +171,18 @@ jobs: - name: Download from S3 run: | aws s3 cp s3://${{ secrets.INSTALLER_PRIVATE_BUCKET_NAME }}/Finch-${GITHUB_REF_NAME}-x86_64.pkg Finch-${GITHUB_REF_NAME}-x86_64.pkg + shell: zsh {0} - name: Silently install run: | sudo installer -pkg Finch-${GITHUB_REF_NAME}-x86_64.pkg -target / + - name: Install Rosetta 2 + run: echo "A" | softwareupdate --install-rosetta || true - name: Build project run: | brew install go lz4 automake autoconf libtool export PATH="/opt/homebrew/opt/libtool/libexec/gnubin:$PATH" make + shell: zsh {0} - name: Multiple instances of Finch test run: | # start two Finch VM instances diff --git a/.github/workflows/upload-build-to-s3.yaml b/.github/workflows/upload-build-to-s3.yaml index 6d2f1d8fe..3799844d2 100644 --- a/.github/workflows/upload-build-to-s3.yaml +++ b/.github/workflows/upload-build-to-s3.yaml @@ -33,6 +33,7 @@ jobs: make download-licenses make FINCH_OS_IMAGE_LOCATION_ROOT=/Applications/Finch tar -zcvf finch.${GITHUB_REF_NAME}.aarch64.tar.gz _output + shell: zsh {0} - name: Upload macos aarch64 build uses: actions/upload-artifact@v2 @@ -42,7 +43,7 @@ jobs: if-no-files-found: error macos-x86_64-build: - runs-on: [self-hosted, macos, amd64, 11.7, release] + runs-on: [self-hosted, macos, amd64, 11, release] timeout-minutes: 60 steps: - uses: actions/checkout@v3 @@ -62,6 +63,7 @@ jobs: make download-licenses make FINCH_OS_IMAGE_LOCATION_ROOT=/Applications/Finch tar -zcvf finch.${GITHUB_REF_NAME}.x86_64.tar.gz _output + shell: zsh {0} - name: Upload macos x86_64 build uses: actions/upload-artifact@v2 diff --git a/.github/workflows/upload-installer-to-release.yaml b/.github/workflows/upload-installer-to-release.yaml index 3a50af1a6..99ce0893d 100644 --- a/.github/workflows/upload-installer-to-release.yaml +++ b/.github/workflows/upload-installer-to-release.yaml @@ -20,6 +20,7 @@ jobs: run: | aws s3 cp s3://${{ secrets.INSTALLER_PRIVATE_BUCKET_NAME }}/Finch-${GITHUB_REF_NAME}-aarch64.pkg Finch-${GITHUB_REF_NAME}-aarch64.pkg aws s3 cp s3://${{ secrets.INSTALLER_PRIVATE_BUCKET_NAME }}/Finch-${GITHUB_REF_NAME}-x86_64.pkg Finch-${GITHUB_REF_NAME}-x86_64.pkg + shell: zsh {0} - name: Upload installers to release uses: softprops/action-gh-release@v1 with: