diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..53ae6b1 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,25 @@ +name: CI + +on: [push] + +jobs: + build: + + runs-on: ubuntu-18.04 + + steps: + - uses: actions/checkout@v1 + - name: Prepare VM + run: | + unset LANG + sudo apt update -qq + sudo LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php -y + sudo apt-get -qq purge graphviz* redis* + sudo apt-get install -qq git python3-setuptools python3-dev python3-apt ccze tree + sudo apt-get -qq autoremove --purge + sudo mkdir -p /etc/mysql/conf.d + echo -e '[client]\nuser = root\npassword = root\n' | sudo tee /etc/mysql/conf.d/my.cnf + - name: Install WordOps + run: sudo timeout 1800 bash install --travis + - name: Run tests + run: sudo timeout 1800 bash tests/travis.sh --actions diff --git a/install b/install index d76dec6..80ca70a 100755 --- a/install +++ b/install @@ -70,6 +70,7 @@ while [ "$#" -gt 0 ]; do ;; --travis) wo_travis="y" + wo_force_install="y" ;; -s | --silent) wo_force_install="y" @@ -496,6 +497,10 @@ wo_install() { # Clone Github repository if it doesn't exist wo_install_travis() { + if [ "$wo_force_install" = "y" ]; then + [ ! -f "$HOME/.gitconfig" ] && { bash -c 'echo -e "[user]\n\tname = $USER\n\temail = root@$HOSTNAME.local" > $HOME/.gitconfig'; } + fi + if [ -f "$HOME/.gitconfig" ]; then # install and redirect log to not print python package install python3 setup.py install diff --git a/tests/travis.sh b/tests/travis.sh index 8104c4d..b28671e 100644 --- a/tests/travis.sh +++ b/tests/travis.sh @@ -9,9 +9,11 @@ CRED="${CSI}1;31m" CGREEN="${CSI}1;32m" CEND="${CSI}0m" -apt-get -qq purge mysql* graphviz* redis* -apt-get install -qq git python3-setuptools python3-dev python3-apt ccze tree -sudo apt-get -qq autoremove --purge +if [ -z "$1" ]; then + apt-get -qq purge mysql* graphviz* redis* + apt-get install -qq git python3-setuptools python3-dev python3-apt ccze tree + sudo apt-get -qq autoremove --purge +fi exit_script() { curl --progress-bar --upload-file /var/log/wo/wordops.log https://transfer.vtbox.net/"$(basename wordops.log)" && echo ""