Skip to content

Commit

Permalink
ci: test bootstrap on macos too
Browse files Browse the repository at this point in the history
  • Loading branch information
branchvincent authored and Branch Vincent committed Jul 13, 2023
1 parent 0830162 commit 59f6a01
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 15 deletions.
11 changes: 8 additions & 3 deletions .config/yadm/bootstrap.d/macos.sh##os.Darwin,e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
# References
# - Inspiration: https://mths.be/macos

if [ -n "${CI:-}" ]; then
debugw "Skipping due to \$CI"
return
fi

### General ###
debug "General"
defaults write NSGlobalDomain AppleInterfaceStyle -string Dark # Dark mode
Expand Down Expand Up @@ -43,9 +48,9 @@ defaults write com.apple.finder _FXSortFoldersFirst -int 1 # Sor
defaults write com.apple.finder QLEnableTextSelection -bool true # Enable copy from quicklook
defaults write com.apple.finder WarnOnEmptyTrash -bool false # Don't warn when emptying trash
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false # Don't warn when changing an extension
for ext in public.{data,json,plain-text,python-script,shell-script,source-code,text,unix-executable} .go .java .{j,t}s{,x} .json .md .py .rb .txt .toml .y{,a}ml; do
duti -s com.microsoft.VSCode "$ext" all # Set VSCode as default app for code
done
# for ext in public.{data,json,plain-text,python-script,shell-script,source-code,text,unix-executable} .go .java .{j,t}s{,x} .json .md .py .rb .txt .toml .y{,a}ml; do
# duti -s com.microsoft.VSCode "$ext" all # Set VSCode as default app for code
# done

### iTerm2 ###
debug "iTerm"
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,18 @@ jobs:
run: brew install fish
- name: Lint
uses: pre-commit/action@v3.0.0

bootstrap:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: [macos, ubuntu]
steps:
- run: |
curl -Lo /usr/local/bin/yadm https://github.com/TheLocehiliosan/yadm/raw/master/yadm
chmod a+x /usr/local/bin/yadm
echo "DEBUG=1" >> $GITHUB_ENV
echo "HOME=$PWD/tmp" >> $GITHUB_ENV
echo "XDG_CONFIG_HOME=" >> $GITHUB_ENV
- run: yadm clone https://github.com/${{ github.repository }}
- run: yadm checkout ${{ github.sha }}
- run: yadm status && tree -a ~
- run: yadm bootstrap
- run: |
export PATH=$HOME/.cargo/bin:/usr/local/bin:/usr/bin:/bin
export HOME=$PWD/tmp DEBUG=1
curl -fsSL https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/bootstrap | bash
12 changes: 8 additions & 4 deletions bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
# Minimal script to bootstrap https://yadm.io before it clones our dotfiles

set -euo pipefail
unset GIT_DIR GIT_WORK_TREE
command -v bash &>/dev/null || { echo >&2 "ERROR: bash must be installed!" && exit 1; }
command -v git &>/dev/null || { echo >&2 "ERROR: git must be installed!" && exit 1; }
unset GIT_DIR GIT_WORK_TREE XDG_CONFIG_HOME
command -v bash &>/dev/null || { printf >&2 "\e[31mERROR\e[0m: bash must be installed!\n" && exit 1; }
command -v git &>/dev/null || { printf >&2 "\e[31mERROR\e[0m: git must be installed!\n" && exit 1; }

# Prompt for and remember password
echo "Prompting for sudo password"
sudo --validate
if [ -t 0 ]; then
sudo --validate
else
sudo -n true
fi
while true; do
sudo -n true
sleep 60
Expand Down

0 comments on commit 59f6a01

Please sign in to comment.