Switch to GitHub Actions
This commit is contained in:
parent
cf366bbf66
commit
d7629553bd
9 changed files with 31 additions and 43 deletions
20
.github/workflows/build.yml
vendored
Normal file
20
.github/workflows/build.yml
vendored
Normal 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
|
16
.travis.yml
16
.travis.yml
|
@ -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
|
|
|
@ -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
|
Dotbot makes installing your dotfiles as easy as `git clone $url && cd dotfiles
|
||||||
&& ./install`, even on a freshly installed system!
|
&& ./install`, even on a freshly installed system!
|
||||||
|
|
|
@ -24,30 +24,14 @@ yellow() {
|
||||||
|
|
||||||
|
|
||||||
check_env() {
|
check_env() {
|
||||||
if [[ "$(whoami)" != "vagrant" && ( "${TRAVIS}" != true || "${CI}" != true ) ]]; then
|
if [[ "$(whoami)" != "vagrant" && "${CI}" != true ]]; then
|
||||||
die "tests must be run inside Travis or Vagrant"
|
die "tests must be run inside Vagrant or CI"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
(
|
rm -rf ~/fakehome
|
||||||
if [ "$(whoami)" == "vagrant" ]; then
|
mkdir -p ~/fakehome
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
initialize() {
|
initialize() {
|
||||||
|
@ -76,7 +60,7 @@ run_test() {
|
||||||
tests_run=$((tests_run + 1))
|
tests_run=$((tests_run + 1))
|
||||||
printf '[%d/%d] (%s)\n' "${tests_run}" "${tests_total}" "${1}"
|
printf '[%d/%d] (%s)\n' "${tests_run}" "${tests_total}" "${1}"
|
||||||
cleanup
|
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
|
pass
|
||||||
else
|
else
|
||||||
fail
|
fail
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
DEBUG=${DEBUG:-false}
|
DEBUG=${DEBUG:-false}
|
||||||
DOTBOT_EXEC="${BASEDIR}/bin/dotbot"
|
DOTBOT_EXEC="${BASEDIR}/bin/dotbot"
|
||||||
DOTFILES="/home/$(whoami)/dotfiles"
|
DOTFILES="${HOME}/dotfiles"
|
||||||
INSTALL_CONF='install.conf.yaml'
|
INSTALL_CONF='install.conf.yaml'
|
||||||
INSTALL_CONF_JSON='install.conf.json'
|
INSTALL_CONF_JSON='install.conf.json'
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,6 @@ EOF
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'test' '
|
test_expect_success 'test' '
|
||||||
[ "$(readlink ~/bad | cut -d/ -f4-)" = "dotfiles/nonexistent" ] &&
|
[ "$(readlink ~/bad | cut -d/ -f5-)" = "dotfiles/nonexistent" ] &&
|
||||||
! test -f ~/x && test -f ~/y
|
! test -f ~/x && test -f ~/y
|
||||||
'
|
'
|
||||||
|
|
|
@ -16,5 +16,5 @@ ${DOTBOT_EXEC} -c dotfiles-symlink/${INSTALL_CONF}
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'test' '
|
test_expect_success 'test' '
|
||||||
[ "$(readlink ~/.f | cut -d/ -f4-)" = "dotfiles/f" ]
|
[ "$(readlink ~/.f | cut -d/ -f5-)" = "dotfiles/f" ]
|
||||||
'
|
'
|
||||||
|
|
|
@ -17,7 +17,7 @@ run_dotbot <<EOF
|
||||||
if: "false"
|
if: "false"
|
||||||
~/.h:
|
~/.h:
|
||||||
path: f
|
path: f
|
||||||
if: "[[ -d ~/d ]]"
|
if: "[ -d ~/d ]"
|
||||||
~/.i:
|
~/.i:
|
||||||
path: f
|
path: f
|
||||||
if: "badcommand"
|
if: "badcommand"
|
||||||
|
|
|
@ -19,5 +19,5 @@ ${DOTBOT_EXEC} -c ./dotfiles-symlink/${INSTALL_CONF}
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'test' '
|
test_expect_success 'test' '
|
||||||
[ "$(readlink ~/.f | cut -d/ -f4-)" = "dotfiles-symlink/f" ]
|
[ "$(readlink ~/.f | cut -d/ -f5-)" = "dotfiles-symlink/f" ]
|
||||||
'
|
'
|
||||||
|
|
Loading…
Reference in a new issue