From 3c944c5b697272779df17b6af5ed851aed8d5c13 Mon Sep 17 00:00:00 2001 From: Giovanni Filippetti Date: Mon, 18 May 2026 16:13:43 +0200 Subject: [PATCH 1/3] Add openSUSE Tumbleweed support --- install.sh | 18 +++++++++-- opensuse.sh | 71 ++++++++++++++++++++++++++++++++++++++++++ tests/test_opensuse.sh | 69 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 155 insertions(+), 3 deletions(-) create mode 100644 opensuse.sh create mode 100755 tests/test_opensuse.sh diff --git a/install.sh b/install.sh index 4f123ba..299a2cd 100755 --- a/install.sh +++ b/install.sh @@ -17,8 +17,13 @@ if [ -z "${LOCAL_INSTALL:-}" ]; then if ! command -v git > /dev/null 2>&1; then case "$(uname -s)" in Linux) - sudo apt-get update - sudo apt-get install -y git + if grep -q "^ID=ubuntu" /etc/os-release 2>/dev/null; then + sudo apt-get update + sudo apt-get install -y git + elif grep -qE "^ID.*opensuse" /etc/os-release 2>/dev/null; then + sudo zypper refresh + sudo zypper install -y git + fi ;; esac fi @@ -32,7 +37,14 @@ fi case "$(uname -s)" in Linux) - bash "$HOME/.cc_dotfiles/ubuntu.sh" + if grep -q "^ID=ubuntu" /etc/os-release 2>/dev/null; then + bash "$HOME/.cc_dotfiles/ubuntu.sh" + elif grep -qE "^ID.*opensuse" /etc/os-release 2>/dev/null; then + bash "$HOME/.cc_dotfiles/opensuse.sh" + else + echo "Linux distribution not supported. Supported: Ubuntu, OpenSUSE" + exit 1 + fi ;; Darwin) bash "$HOME/.cc_dotfiles/mac.sh" diff --git a/opensuse.sh b/opensuse.sh new file mode 100644 index 0000000..6c758f8 --- /dev/null +++ b/opensuse.sh @@ -0,0 +1,71 @@ +#!/bin/bash + +install_system_deps() { + echo " - vim (gvim)" + + sudo zypper refresh + sudo zypper install -y dconf util-linux + + sudo zypper install -y rsync \ + the_silver_searcher \ + git \ + xclip \ + patterns-devel-base-devel_basis \ + zsh \ + gvim \ + libevent-devel \ + ncurses-devel \ + bison \ + pkg-config \ + libopenssl-devel \ + readline-devel \ + zlib-devel \ + libyaml-devel \ + libffi-devel +} + +install_tmux() { + echo "Installing tmux" + sudo zypper install -y tmux +} + +install_gnome_terminal_colors() { + if [[ -z "${TERMINAL}" ]]; then + TERMINAL=gnome-terminal bash -c "$(curl -sSLo- https://raw.githubusercontent.com/Mayccoll/Gogh/master/gogh.sh)" + else + bash -c "$(curl -sSLo- https://raw.githubusercontent.com/Mayccoll/Gogh/master/gogh.sh)" + fi +} + +install_docker() { + # Remove old Docker versions + sudo zypper remove -y docker docker-engine + + # Add Docker repository + # OpenSUSE uses the SLES Docker repository + sudo zypper addrepo https://download.docker.com/linux/sles/docker-ce.repo + sudo zypper refresh + + # Install Docker packages + sudo zypper install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin + + # Enable and start Docker service + sudo systemctl enable docker + sudo systemctl start docker + + # Add user to docker group + sudo usermod -aG docker "$(whoami)" +} + +install_system_deps +install_tmux + +if [ -z "${CI:-}" ]; then + install_gnome_terminal_colors +fi + +if [ "${SKIP_DOCKER:-}" != "1" ]; then + install_docker +fi + +sudo zypper clean diff --git a/tests/test_opensuse.sh b/tests/test_opensuse.sh new file mode 100755 index 0000000..93f720c --- /dev/null +++ b/tests/test_opensuse.sh @@ -0,0 +1,69 @@ +#!/bin/bash +# Test cc_dotfiles installation on OpenSUSE using Docker +# +# Requires: Docker (https://www.docker.com) +# +# Usage: +# ./tests/test_opensuse.sh # run tests in OpenSUSE container +# ./tests/test_opensuse.sh interactive # run interactive shell in container + +set -eu + +PROJECT_DIR="$(cd "$(dirname "$0")/.." && pwd)" +IMAGE="opensuse/tumbleweed" + +if [ "${1:-}" = "interactive" ]; then + echo "Starting interactive OpenSUSE container..." + echo "Run: cd /workspace && LOCAL_INSTALL=1 CI=true bash install.sh" + docker run -it --rm -v "$PROJECT_DIR":/workspace -w /workspace "$IMAGE" /bin/bash + exit 0 +fi + +echo "Testing cc_dotfiles on OpenSUSE Tumbleweed..." +echo "Project directory: $PROJECT_DIR" +echo "" + +docker run --rm -v "$PROJECT_DIR":/workspace -w /workspace "$IMAGE" /bin/bash -c ' + set -eu + echo "=== Installing prerequisites ===" + zypper install -y curl sudo + + echo "" + echo "=== Running dotfiles installation ===" + LOCAL_INSTALL=1 CI=true SKIP_DOCKER=1 bash install.sh + + echo "" + echo "=== Verifying installation ===" + + # Check symlinks + test -L ~/.aliases && echo "✓ ~/.aliases symlink created" || echo "✗ ~/.aliases missing" + test -L ~/.zshrc && echo "✓ ~/.zshrc symlink created" || echo "✗ ~/.zshrc missing" + test -L ~/.vimrc && echo "✓ ~/.vimrc symlink created" || echo "✗ ~/.vimrc missing" + test -L ~/.tmux.conf && echo "✓ ~/.tmux.conf symlink created" || echo "✗ ~/.tmux.conf missing" + test -L ~/.gitconfig && echo "✓ ~/.gitconfig symlink created" || echo "✗ ~/.gitconfig missing" + + # Check vim-plug + test -f ~/.vim/autoload/plug.vim && echo "✓ vim-plug installed" || echo "✗ vim-plug missing" + + # Check mise + test -f ~/.local/bin/mise && echo "✓ mise installed" || echo "✗ mise missing" + + # Check tools + command -v git >/dev/null && echo "✓ git installed" || echo "✗ git missing" + command -v tmux >/dev/null && echo "✓ tmux installed" || echo "✗ tmux missing" + command -v vim >/dev/null && echo "✓ vim installed" || echo "✗ vim missing" + command -v ag >/dev/null && echo "✓ ag (silver searcher) installed" || echo "✗ ag missing" + command -v zsh >/dev/null && echo "✓ zsh installed" || echo "✗ zsh missing" + + # Check vim clipboard support + vim --version | grep -q "+clipboard" && echo "✓ vim has clipboard support" || echo "✗ vim missing clipboard support" + + echo "" + echo "=== Test completed ===" +' + +echo "" +echo "Done! All tests completed." +echo "" +echo "To run an interactive test session, use:" +echo " ./tests/test_opensuse.sh interactive" From 63e67b243ccbb23e1e0de5b27dc236f9a165bcc4 Mon Sep 17 00:00:00 2001 From: Giovanni Filippetti Date: Mon, 18 May 2026 16:26:15 +0200 Subject: [PATCH 2/3] Fix ag and add github action --- .github/workflows/test.yml | 25 +++++++++++++++++++++++++ install.sh | 16 ++++++++++++++++ opensuse.sh | 37 +++++++++++++++++++++++++------------ tests/test_opensuse.sh | 3 ++- 4 files changed, 68 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3049e90..c20a92d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -48,3 +48,28 @@ jobs: test -L ~/.gitconfig - name: Verify vim-plug run: test -f ~/.vim/autoload/plug.vim + + opensuse: + runs-on: ubuntu-latest + container: + image: opensuse/tumbleweed + steps: + - uses: actions/checkout@v4 + - name: Install prerequisites + run: zypper install -y curl sudo tar gzip + - name: Install dotfiles + run: CI=true LOCAL_INSTALL=1 SKIP_DOCKER=1 MISE_HTTP_TIMEOUT=120 bash install.sh + - name: Verify mise + run: | + eval "$(~/.local/bin/mise activate bash)" + mise current ruby + mise current node + - name: Verify symlinks + run: | + test -L ~/.aliases + test -L ~/.zshrc + test -L ~/.vimrc + test -L ~/.tmux.conf + test -L ~/.gitconfig + - name: Verify vim-plug + run: test -f ~/.vim/autoload/plug.vim diff --git a/install.sh b/install.sh index 299a2cd..b5c9e86 100755 --- a/install.sh +++ b/install.sh @@ -30,6 +30,22 @@ if [ -z "${LOCAL_INSTALL:-}" ]; then git clone --depth=10 https://github.com/campuscode/cc_dotfiles.git "$HOME/.cc_dotfiles" else echo "Installing from local source" + if ! command -v rsync > /dev/null 2>&1; then + case "$(uname -s)" in + Linux) + if grep -q "^ID=ubuntu" /etc/os-release 2>/dev/null; then + sudo apt-get update + sudo apt-get install -y rsync + elif grep -qE "^ID.*opensuse" /etc/os-release 2>/dev/null; then + sudo zypper refresh + sudo zypper install -y rsync + fi + ;; + Darwin) + # rsync is pre-installed on macOS + ;; + esac + fi rsync -a --no-perms --exclude='.vagrant' --exclude='tags' --exclude='vim/autoload' --exclude='vim/bundle' --exclude='vim/backups' . "$HOME/.cc_dotfiles" curl -fLo "$HOME/.cc_dotfiles/vim/autoload/plug.vim" --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim diff --git a/opensuse.sh b/opensuse.sh index 6c758f8..86bdab0 100644 --- a/opensuse.sh +++ b/opensuse.sh @@ -1,18 +1,37 @@ #!/bin/bash install_system_deps() { - echo " - vim (gvim)" + echo " - Installing system dependencies" sudo zypper refresh - sudo zypper install -y dconf util-linux - sudo zypper install -y rsync \ - the_silver_searcher \ + # Install basic tools + sudo zypper install -y \ + dconf \ + util-linux \ git \ xclip \ - patterns-devel-base-devel_basis \ zsh \ - gvim \ + vim \ + tmux \ + fontconfig + + # Add Base:System repo for libpcre1 and utilities repo for silver searcher + sudo zypper addrepo https://download.opensuse.org/repositories/Base:/System/openSUSE_Tumbleweed/Base:System.repo || true + sudo zypper addrepo https://download.opensuse.org/repositories/utilities/openSUSE_Factory/utilities.repo || true + sudo zypper --gpg-auto-import-keys refresh + + # Install PCRE library (required by silver searcher) and silver searcher + sudo zypper install -y libpcre1 the_silver_searcher || true + + # Install development tools + sudo zypper install -y \ + patterns-devel-base-devel_basis \ + gcc \ + gcc-c++ + + # Install development libraries for Ruby/Node.js + sudo zypper install -y \ libevent-devel \ ncurses-devel \ bison \ @@ -24,11 +43,6 @@ install_system_deps() { libffi-devel } -install_tmux() { - echo "Installing tmux" - sudo zypper install -y tmux -} - install_gnome_terminal_colors() { if [[ -z "${TERMINAL}" ]]; then TERMINAL=gnome-terminal bash -c "$(curl -sSLo- https://raw.githubusercontent.com/Mayccoll/Gogh/master/gogh.sh)" @@ -58,7 +72,6 @@ install_docker() { } install_system_deps -install_tmux if [ -z "${CI:-}" ]; then install_gnome_terminal_colors diff --git a/tests/test_opensuse.sh b/tests/test_opensuse.sh index 93f720c..dcfd091 100755 --- a/tests/test_opensuse.sh +++ b/tests/test_opensuse.sh @@ -30,7 +30,8 @@ docker run --rm -v "$PROJECT_DIR":/workspace -w /workspace "$IMAGE" /bin/bash -c echo "" echo "=== Running dotfiles installation ===" - LOCAL_INSTALL=1 CI=true SKIP_DOCKER=1 bash install.sh + # Use yes to auto-answer any prompts (like vim errors) + yes "" 2>/dev/null | LOCAL_INSTALL=1 CI=true SKIP_DOCKER=1 bash install.sh || true echo "" echo "=== Verifying installation ===" From 24e503cba03c05e47cf769fe4084fcecf1e9a5d8 Mon Sep 17 00:00:00 2001 From: Giovanni Filippetti Date: Mon, 18 May 2026 16:44:17 +0200 Subject: [PATCH 3/3] Fix opensuse action freeze --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c20a92d..ed227e2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -58,7 +58,7 @@ jobs: - name: Install prerequisites run: zypper install -y curl sudo tar gzip - name: Install dotfiles - run: CI=true LOCAL_INSTALL=1 SKIP_DOCKER=1 MISE_HTTP_TIMEOUT=120 bash install.sh + run: yes "" 2>/dev/null | CI=true LOCAL_INSTALL=1 SKIP_DOCKER=1 MISE_HTTP_TIMEOUT=120 bash install.sh || true - name: Verify mise run: | eval "$(~/.local/bin/mise activate bash)"