aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGertjan van den Burg <gertjanvandenburg@gmail.com>2020-12-28 15:23:12 +0000
committerGertjan van den Burg <gertjanvandenburg@gmail.com>2020-12-28 15:23:12 +0000
commit103fc916f7c4b3ea2a1cfdc470e7694b6d6d21bc (patch)
treeec804b5bf5f15308c5a85928e4ce009bd9c8eb06
parentBump version and update changelog and readme (diff)
parentMerge branch 'master' into feature/gh_actions (diff)
downloadpaper2remarkable-103fc916f7c4b3ea2a1cfdc470e7694b6d6d21bc.tar.gz
paper2remarkable-103fc916f7c4b3ea2a1cfdc470e7694b6d6d21bc.zip
Merge branch 'feature/gh_actions'
-rwxr-xr-x.github/scripts/test_p2r.sh60
-rw-r--r--.github/workflows/test.yml21
-rw-r--r--README.md2
3 files changed, 82 insertions, 1 deletions
diff --git a/.github/scripts/test_p2r.sh b/.github/scripts/test_p2r.sh
new file mode 100755
index 0000000..5236c74
--- /dev/null
+++ b/.github/scripts/test_p2r.sh
@@ -0,0 +1,60 @@
+#!/bin/bash
+#
+# Setup environment and run unit tests for paper2remarkable
+#
+# After Travis effectively removed support for open source projects I've
+# decided to capture all testing facilities in a single script, to ensure we
+# can more easily move between CI providers.
+#
+# This script is intended to be run inside a virtual machine (or equivalent)
+# that runs Ubuntu Xenial. It will affect the system installed packages.
+#
+# Author: G.J.J. van den Burg
+# Date: 2020-12-28
+#
+
+set -e -u -x -o pipefail
+
+NODE_VERSION="v12.18.1"
+NVM_VERSION="v0.36.0"
+
+echo "Setting up environment"
+echo -e "\tUpdating system ..."
+
+sudo apt-get update
+
+echo -e "\tInstalling system dependencies for paper2remarkable"
+
+sudo apt-get install ghostscript pdftk poppler-utils qpdf
+
+echo -e "\tInstalling nvm ..."
+
+sudo apt-get install build-essential libssl-dev -y
+
+curl -o- "https://raw.githubusercontent.com/nvm-sh/nvm/${NVM_VERSION}/install.sh" | bash
+
+source ~/.nvm/nvm.sh
+
+echo -e "\tInstalling node version ${NODE_VERSION}"
+
+nvm install ${NODE_VERSION}
+
+echo -e "\tActivating node version ${NODE_VERSION}"
+
+nvm use ${NODE_VERSION}
+
+echo -e "Installing pre-commit"
+
+pip install pre-commit
+
+echo -e "Install package"
+
+pip install -e .[test]
+
+echo -e "Run pre-commit"
+
+pre-commit run --all-files --show-diff-on-failure
+
+echo -e "Run unit tests"
+
+green -vv -a ./tests
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 0000000..bf8972e
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,21 @@
+name: build
+
+on: push
+
+jobs:
+ p2r-test:
+ name: Unit tests for paper2remarkable
+ runs-on: ubuntu-16.04
+
+ steps:
+ - name: Install Python 3.6
+ uses: actions/setup-python@v2
+ with:
+ python-version: '3.6'
+
+ - name: Checkout code
+ uses: actions/checkout@v2
+
+ - name: Run unit test script
+ run: ./.github/scripts/test_p2r.sh
+ shell: bash
diff --git a/README.md b/README.md
index 05b73ad..d212549 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
# paper2remarkable
[![PyPI version](https://badge.fury.io/py/paper2remarkable.svg)](https://pypi.org/project/paper2remarkable)
-[![Build Status](https://travis-ci.org/GjjvdBurg/paper2remarkable.svg?branch=master)](https://travis-ci.org/GjjvdBurg/paper2remarkable)
+[![Build status](https://github.com/GjjvdBurg/paper2remarkable/workflows/build/badge.svg)](https://github.com/GjjvdBurg/paper2remarkable/actions)
[![Downloads](https://pepy.tech/badge/paper2remarkable)](https://pepy.tech/project/paper2remarkable)
``paper2remarkable`` is a command line program for quickly and easily