diff --git a/.github/workflows/chezmoi.yml b/.github/workflows/chezmoi.yml new file mode 100644 index 00000000..e9f47cc3 --- /dev/null +++ b/.github/workflows/chezmoi.yml @@ -0,0 +1,111 @@ +name: chezmoi + +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + +permissions: + contents: read + +env: + HOMEBREW_NO_ANALYTICS: "1" + HOMEBREW_NO_ENV_HINTS: "1" + HOMEBREW_NO_INSTALL_CLEANUP: "1" + +jobs: + apply: + name: Apply (${{ matrix.type }}) + runs-on: macos-26 + timeout-minutes: 30 + strategy: + fail-fast: false + matrix: + type: [work, private, workstation] + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install chezmoi + run: brew install chezmoi python-yq + + - name: Apply chezmoi + shell: bash + run: | + set -euo pipefail + + home="$RUNNER_TEMP/home" + cache="$RUNNER_TEMP/chezmoi-cache" + config="$RUNNER_TEMP/chezmoi.toml" + state="$RUNNER_TEMP/chezmoi-state/chezmoistate.boltdb" + + mkdir -p "$home" "$cache" "$(dirname "$state")" + export HOME="$home" + + cat > "$config" <