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 d6d8cb1
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 9 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,33 @@ 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
which -a brew || echo no brew
which -a rustup || echo no rustup
which -a curl || echo no curl
echo PATH: $PATH
sudo cat /etc/sudoers
# echo "PATH=$(echo "$PATH" | tr : \n | grep -v cargo | tr \n :)" >> $GITHUB_ENV
- run: whoami
- run: sudo whoami
- run: sudo echo ok || true
- run: sudo -n true
- run: sudo -l
# - run: SUDO_ASKPASS=false sudo -v
# - run: sudo -S --validate || true
- run: |
export PATH=/usr/local/bin:/usr/bin:/bin
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 -l true
fi
while true; do
sudo -n true
sleep 60
Expand Down

0 comments on commit d6d8cb1

Please sign in to comment.