Skip to content

Commit

Permalink
ci: Fix brew/aws command and Rosetta tests (#403)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
KevinLiAWS authored May 16, 2023
1 parent 45ec06f commit 0dfeaa9
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/release-homebrew.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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 }}
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/release-installer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/upload-build-to-s3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/upload-installer-to-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 0dfeaa9

Please sign in to comment.