Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add circle config for validating my changes on fresh machines #1

Merged
merged 12 commits into from
Sep 26, 2018
41 changes: 41 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
version: 2
jobs:
build:
working_directory: ~/dotfiles/dotfiles
docker:
- image: assertible/ci
steps:
- checkout

- run: apt update
- run: |
apt install -y --no-install-recommends \
xvfb xinit x11-xserver-utils \
xserver-xorg libx11-dev \
libxrandr-dev libxft-dev

- run: apt install stow emacs -y --no-install-recommends

# avoid stow tree-folding the whole dir
- run: mkdir -p ~/.stack/{programs,snapshots}

# remove pre-existing dotfiles (stow will not)
- run: rm ~/.profile ~/.bashrc ~/.gitconfig

- run: make dotfiles
- run: xvfb-run make dotemacs
- run: xvfb-run make theme

- restore_cache:
keys:
- v1-dotcache-{{ .Branch }}
- v1-dotcache

- run: xvfb-run make xmonad

- save_cache:
key: v1-dotcache-{{ .Branch }}
paths:
- ~/.stack/

# - run: cd $HOME && xvfb-run startx
21 changes: 13 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ PKG_DIR ?= $(or $(target),$(HOME))
THEME ?= $(or $(q),mocha-256)
THEME_DIR := x11/.local/share/base16-xresources/xresources

STACK_VERSION := 1.7.1
XMONAD := $(HOME)/.xmonad/xmonad-x86_64-linux
XMOBAR_BIN := $(HOME)/.local/bin/xmobar
XMONAD_BIN := $(HOME)/.local/bin/xmonad
Expand All @@ -22,12 +21,12 @@ STOW_FLAGS := --verbose -v1 --target=$(PKG_DIR)
STOW_FLAGS += --ignore="gnupg/.gnupg/.*.gpg" --ignore=.*.pem

.PHONY: simulate
simulate: $(THEME_DIR)
@stow ${STOW_FLAGS} ${PACKAGES}
simulate: submodules
@stow ${STOW_FLAGS} --simulate ${PACKAGES}


.PHONY: dotfiles
dotfiles: $(THEME_DIR)
dotfiles: submodules
@stow ${STOW_FLAGS} -v1 --target=$(PKG_DIR) ${PACKAGES}

.PHONY: dotlocal
Expand All @@ -54,15 +53,15 @@ $(XMOBAR_BIN): stack/.stack/global-project/stack.yaml stack/.stack/config.yaml


# New base16 themes: https://github.com/chriskempson/base16
theme: $(THEME_DIR)
theme: submodules
@fc-cache -vf
@xrdb -remove
@xrdb -merge ~/.Xresources
@xrdb -merge $(THEME_DIR)/base16-$(THEME).Xresources
@xrdb -override $(THEME_DIR)/base16-$(THEME).Xresources


themes-list: $(THEME_DIR)
themes-list: submodules
@echo
@echo "Usage: $ make theme q=mocha[-256]"
@echo
Expand All @@ -73,8 +72,14 @@ themes-list: $(THEME_DIR)
| xargs basename --suffix=.Xresources \
| column

$(THEME_DIR):
@git submodule update --init $(shell dirname $(THEME_DIR))
# Check for git submodules which are not initialized (prefixed with "-").
#
# It's possible check if they not initialized _or_ dirty using '^[-]|^[+]'
.PHONY: submodules
submodules:
@if git submodule status | egrep -q '^[-]'; then \
git submodule update --init; \
fi

dotemacs:
@emacs --batch --debug-init -l emacs/.emacs --eval '(load "~/.emacs")'
Expand Down
2 changes: 1 addition & 1 deletion emacs/.emacs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
(setq projectile-enable-caching t
projectile-indexing-method 'alien
projectile-use-git-grep 't
projectile-project-search-path '("~/dev")
;;projectile-project-search-path '("~/dev")
projectile-globally-ignored-directories '("~/.stack/snapshots")
projectile-tags-command "make tags")

Expand Down