1
0
Fork 0
mirror of synced 2024-11-17 05:55:34 -05:00

Switch to GitHub Actions

This commit is contained in:
Anish Athalye 2020-12-18 14:34:28 -05:00
parent cf366bbf66
commit d7629553bd
9 changed files with 31 additions and 43 deletions

20
.github/workflows/build.yml vendored Normal file
View file

@ -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

View file

@ -1,16 +0,0 @@
language: python
python:
- "2.7"
- "pypy"
- "3.4"
- "3.5"
- "3.6"
- "3.7"
- "3.8"
- "nightly"
- "pypy3"
sudo: false
script:
- ./test/test

View file

@ -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!

View file

@ -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() {
@ -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

View file

@ -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'

View file

@ -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
'

View file

@ -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" ]
'

View file

@ -17,7 +17,7 @@ run_dotbot <<EOF
if: "false"
~/.h:
path: f
if: "[[ -d ~/d ]]"
if: "[ -d ~/d ]"
~/.i:
path: f
if: "badcommand"

View file

@ -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" ]
'