Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
validate-chezmoi:
name: Validate chezmoi configuration
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install chezmoi
run: |
sh -c "$(curl -fsLS get.chezmoi.io)" -- -b /usr/local/bin
chezmoi --version

- name: Initialize chezmoi with test data
run: |
# Create a test config directory
export CHEZMOI_SOURCE_DIR="${{ github.workspace }}/home"
export CHEZMOI_DEST_DIR="/tmp/chezmoi-test-dest"

# Create test .chezmoi.toml.yaml with all required variables
mkdir -p ~/.config/chezmoi
cat > ~/.config/chezmoi/chezmoi.toml << EOF
[data]
name = "CI Test User"
email = "ci@example.com"
editor = "vim"
installZsh = false
installPython = false
installNode = false
installNeovim = false
installCliTools = false
installTmux = false
installDirenv = false
installLspServers = false
installOpencode = false
installNerdFonts = false
installStarship = false
opencodeClaudeMax = false
opencodeClaude = false
opencodeChatgpt = false
opencodeGemini = false
pythonVersion = "3.12"
nodeVersion = "22"
secretsPath = ""
generateSshKey = false
sshKeyType = "ed25519"

[git]
autoCommit = false
autoPush = false
EOF

- name: Validate template syntax
run: |
# Initialize chezmoi with the source directory
chezmoi init --source="${{ github.workspace }}/home"

# Try to apply in dry-run mode to validate all templates
echo "Running chezmoi apply --dry-run to validate configuration..."
chezmoi apply --dry-run --verbose

- name: Verify chezmoi data
run: |
echo "Verifying chezmoi data variables..."
chezmoi data

- name: Summary
run: |
echo "✅ All chezmoi configuration checks passed!"
Loading