Skip to content

Commit

Permalink
Switch to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
anishathalye committed Dec 18, 2020
1 parent cf366bb commit d762955
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 43 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: CI
on:
push:
schedule:
- cron: '0 8 * * 6'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python: [2.7, pypy2, 3.4, 3.5, 3.6, 3.7, 3.8, pypy3]
name: Python ${{ matrix.python }}
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- run: ./test/test
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Dotbot [![Build Status](https://travis-ci.com/anishathalye/dotbot.svg?branch=master)](https://travis-ci.com/anishathalye/dotbot)
# Dotbot [![Build Status](https://github.com/anishathalye/dotbot/workflows/CI/badge.svg)](https://github.com/anishathalye/dotbot/actions?query=workflow%3ACI)

Dotbot makes installing your dotfiles as easy as `git clone $url && cd dotfiles
&& ./install`, even on a freshly installed system!
Expand Down
26 changes: 5 additions & 21 deletions test/driver-lib.bash
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,14 @@ yellow() {


check_env() {
if [[ "$(whoami)" != "vagrant" && ( "${TRAVIS}" != true || "${CI}" != true ) ]]; then
die "tests must be run inside Travis or Vagrant"
if [[ "$(whoami)" != "vagrant" && "${CI}" != true ]]; then
die "tests must be run inside Vagrant or CI"
fi
}

cleanup() {
(
if [ "$(whoami)" == "vagrant" ]; then
cd $HOME
find . -not \( \
-path './.pyenv' -o \
-path './.pyenv/*' -o \
-path './.bashrc' -o \
-path './.profile' -o \
-path './.ssh' -o \
-path './.ssh/*' \
\) -delete >/dev/null 2>&1
else
find ~ -mindepth 1 -newermt "${date_stamp}" \
-not \( -path ~ -o -path "${BASEDIR}/*" \
-o -path ~/dotfiles \) \
-exec rm -rf {} +
fi
) || true
rm -rf ~/fakehome
mkdir -p ~/fakehome
}

initialize() {
Expand Down Expand Up @@ -76,7 +60,7 @@ run_test() {
tests_run=$((tests_run + 1))
printf '[%d/%d] (%s)\n' "${tests_run}" "${tests_total}" "${1}"
cleanup
if (cd "${BASEDIR}/test/tests" && DOTBOT_TEST=true bash "${1}"); then
if (cd "${BASEDIR}/test/tests" && HOME=~/fakehome DOTBOT_TEST=true bash "${1}"); then
pass
else
fail
Expand Down
2 changes: 1 addition & 1 deletion test/test-lib.bash
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
DEBUG=${DEBUG:-false}
DOTBOT_EXEC="${BASEDIR}/bin/dotbot"
DOTFILES="/home/$(whoami)/dotfiles"
DOTFILES="${HOME}/dotfiles"
INSTALL_CONF='install.conf.yaml'
INSTALL_CONF_JSON='install.conf.json'

Expand Down
2 changes: 1 addition & 1 deletion test/tests/except-multi.bash
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ EOF
'

test_expect_success 'test' '
[ "$(readlink ~/bad | cut -d/ -f4-)" = "dotfiles/nonexistent" ] &&
[ "$(readlink ~/bad | cut -d/ -f5-)" = "dotfiles/nonexistent" ] &&
! test -f ~/x && test -f ~/y
'
2 changes: 1 addition & 1 deletion test/tests/link-canonicalize.bash
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ ${DOTBOT_EXEC} -c dotfiles-symlink/${INSTALL_CONF}
'

test_expect_success 'test' '
[ "$(readlink ~/.f | cut -d/ -f4-)" = "dotfiles/f" ]
[ "$(readlink ~/.f | cut -d/ -f5-)" = "dotfiles/f" ]
'
2 changes: 1 addition & 1 deletion test/tests/link-if.bash
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ run_dotbot <<EOF
if: "false"
~/.h:
path: f
if: "[[ -d ~/d ]]"
if: "[ -d ~/d ]"
~/.i:
path: f
if: "badcommand"
Expand Down
2 changes: 1 addition & 1 deletion test/tests/link-no-canonicalize.bash
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ ${DOTBOT_EXEC} -c ./dotfiles-symlink/${INSTALL_CONF}
'

test_expect_success 'test' '
[ "$(readlink ~/.f | cut -d/ -f4-)" = "dotfiles-symlink/f" ]
[ "$(readlink ~/.f | cut -d/ -f5-)" = "dotfiles-symlink/f" ]
'

0 comments on commit d762955

Please sign in to comment.