migrate rustup to xdg base directories #26
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: 'Fresh install dotfiles' | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
permissions: | |
contents: read | |
pull-requests: read | |
concurrency: | |
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | |
cancel-in-progress: true | |
env: | |
HOMEBREW_NO_ANALYTICS: 1 | |
jobs: | |
install-dotfiles: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
id: checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Cache Homebrew | |
id: cache-homebrew | |
uses: actions/cache@v4 | |
if: runner.os != 'macOS' | |
with: | |
path: | | |
/home/linuxbrew/.linuxbrew | |
key: ${{ runner.os }}-${{ hashFiles('**/Brewfile', '**/Brewfile.lock.json') }}-homebrew | |
- name: Cache asdf | |
id: cache-asdf | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.asdf | |
key: ${{ runner.os }}-${{ hashFiles('**/asdf/tool-versions') }}-asdf | |
- name: Bootstrap dotfiles | |
id: bootstrap-dotfiles | |
run: | | |
# symlink the dotfiles to the current users home directory | |
ln -sf $GITHUB_WORKSPACE $HOME/.dotfiles | |
./bootstrap | |
- name: Setup Homebrew env | |
id: setup-homebrew-env | |
if: runner.os != 'macOS' | |
run: | | |
# add all relevant env to github actions env | |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" | |
echo "HOMEBREW_PREFIX=$HOMEBREW_PREFIX" >> "$GITHUB_ENV" | |
echo "HOMEBREW_CELLAR=$HOMEBREW_CELLAR" >> "$GITHUB_ENV" | |
echo "HOMEBREW_REPOSITORY=$HOMEBREW_REPOSITORY" >> "$GITHUB_ENV" | |
echo "$HOMEBREW_PREFIX/bin:$HOMEBREW_PREFIX/sbin" >> "$GITHUB_PATH" | |
- name: Verify | |
id: verify | |
shell: zsh {0} | |
env: | |
TERM: xterm-256color | |
run: ./doctor --nvim |