Use a scratch variable for some installs #244
This file contains hidden or 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: dotfiles-CI | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: ${{github.ref}}-${{github.head_ref}}-ci | |
| cancel-in-progress: true | |
| jobs: | |
| Dotfiles: | |
| runs-on: ${{matrix.os}} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: marchdf/dotfiles | |
| path: dotfiles | |
| - name: Dependencies | |
| run: | | |
| bash ./dotfiles/bin/executable_install_bootstrap_dependencies.sh | |
| - name: Add arch-specific bin to PATH | |
| run: | | |
| ARCH=$(uname -m) | |
| echo "$HOME/.local/${ARCH}/bin" >> $GITHUB_PATH | |
| - name: Clone dotfiles | |
| run: | | |
| mkdir -p "$HOME/.local/share/chezmoi" | |
| git config --global --add safe.directory "$HOME/.local/share/chezmoi" | |
| git clone --depth 1 --branch "${{ github.head_ref || github.ref_name }}" https://github.com/marchdf/dotfiles.git "$HOME/.local/share/chezmoi" | |
| - name: Install | |
| run: | | |
| chezmoi init --source="$HOME/.local/share/chezmoi" --promptBool test_machine=t,"Use ZSH_ROOT_DIR for tmux shell"=f --promptString email="",scratch_root="" | |
| chezmoi data | |
| chezmoi apply | |
| - name: Cold start zsh | |
| env: | |
| TERM: xterm-256color | |
| run: | | |
| time zsh -i -c exit | |
| - name: Warm start zsh | |
| env: | |
| TERM: xterm-256color | |
| run: | | |
| time zsh -i -c exit | |
| - name: Verify tools | |
| env: | |
| TERM: xterm-256color | |
| DISABLE_AUTO_TITLE: true | |
| shell: zsh {0} | |
| run: | | |
| source ~/.zshrc | |
| for TOOL in python pyenv uv poetry zoxide fzf bat; do | |
| if [[ ! -x "$(command -v ${TOOL})" ]]; then | |
| echo "${TOOL} not found!" | |
| exit 1 | |
| else | |
| echo "${TOOL} found: $(${TOOL} --version 2>&1 | head -n1)" | |
| fi | |
| done |