add brew autoremove
to setup.sh, and support apple/Intel silicon mac
#789
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: setup machine | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
setup_and_update: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
# macos-13 is for intel silicon mac. | |
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories | |
os: [macos-latest, macos-13] | |
timeout-minutes: 60 | |
steps: | |
- name: workaround setup for github runner macos | |
run: |- | |
# https://github.com/sensuikan1973/dotfiles/pull/125#issuecomment-1502177344 | |
brew unlink [email protected] && brew link --overwrite [email protected] | |
# https://github.com/sensuikan1973/dotfiles/pull/155#issuecomment-1903326589 | |
# https://github.com/sensuikan1973/dotfiles/pull/155#issuecomment-1903348781 | |
# https://github.com/sensuikan1973/dotfiles/pull/155#issuecomment-1903356380 | |
brew unlink [email protected] && brew link --overwrite [email protected] | |
# https://github.com/sensuikan1973/dotfiles/pull/155#issuecomment-1903251250 | |
rm -f '/usr/local/bin/pod' | |
# https://docs.brew.sh/FAQ#how-do-i-uninstall-homebrew | |
NONINTERACTIVE=1 sudo /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)" | |
# https://github.com/sensuikan1973/dotfiles/pull/129#issuecomment-1505823099 | |
sudo rm -rf /Applications/Google\ Chrome.app | |
- name: checkout repository to HOME | |
run: |- | |
git clone https://github.com/sensuikan1973/dotfiles.git ~/dotfiles | |
cd ~/dotfiles | |
# See: https://qiita.com/sonots/items/16df445132e704198e3e | |
# See: https://github.com/actions/checkout/issues/23 | |
git fetch origin '+refs/pull/*:refs/remotes/pr/*' --prune | |
git checkout "$GITHUB_SHA" | |
# setup twice | |
# NOTE: I want to ensure idempotent | |
- name: 1st, run setup script | |
run: cd ~/dotfiles && ./setup.sh | |
- name: 2nd, run setup script | |
run: cd ~/dotfiles && ./setup.sh && which zsh | |
- name: rough command test | |
# See: https://docs.github.com/ja/actions/learn-github-actions/environment-variables | |
# See: etc/shells and https://github.com/actions/runner-images/issues/2187 | |
shell: /usr/bin/zsh {0} | |
run: |- | |
echo "$SHELL" | |
set -euxo pipefail | |
source "$HOME/.zshrc" | |
zsh --version | |
which brew | |
brew --prefix | |
uname | |
time | |
cd "$HOME/dotfiles" | |
ls | |
la | |
ll | |
g status && fp | |
rbenv --version | |
nodenv --version | |
pyenv --version | |
# my functions | |
find-bigN 3 | |
disk-rankN 3 | |
force_prune_docker_system_all | |
install_latest_nodejs | |
# https://github.com/sensuikan1973/dotfiles/pull/129#issuecomment-1506168490 | |
# https://github.com/rbenv/ruby-build/discussions/2118 | |
brew reinstall libyaml | |
install_latest_ruby | |
export NODENV_VERSION=$(nodenv versions --bare | head -n 1) # https://www.aruse.net/entry/2020/03/21/131101 | |
node --version | |
yarn --version | |
rbenv shell $(rbenv versions --bare | head -n 1) | |
ruby --version | |
# pod --version | |
openssl --version | |
- name: upgrade_system_deps test | |
shell: /usr/bin/zsh {0} | |
run: |- | |
echo "$SHELL" | |
set -euxo pipefail | |
source "$HOME/.zshrc" | |
zsh --version | |
echo "$GITHUB_HEAD_REF" | |
upgrade_system_deps -branch "$GITHUB_HEAD_REF" | |
flutter doctor | |
dart --version | |
code --version | |
gcloud --version | |
gcloud config list | |
# upgrade_all_softwareupdate | |
# # session for debug | |
# - name: setup tmate session for debug ssh | |
# if: ${{ failure() }} | |
# uses: mxschmitt/action-tmate@v3 |