From 8516844d00530b82698236a16c19c77a6e5fe212 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Mon, 28 Dec 2020 14:25:37 +0000 Subject: Add tentative support for Github Actions --- .github/scripts/test_p2r.sh | 60 +++++++++++++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 21 ++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 .github/scripts/test_p2r.sh create mode 100644 .github/workflows/test.yml diff --git a/.github/scripts/test_p2r.sh b/.github/scripts/test_p2r.sh new file mode 100644 index 0000000..e7c1139 --- /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-11-06 +# + +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..d69f3eb --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,21 @@ +name: Test paper2reMarkable + +on: push + +jobs: + p2r-test: + name: Unit tests for paper2remarkable + runs-on: ubuntu-xenial + + 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 -- cgit v1.2.3 From 441ff237b70c1c7149c6f5076d3ea61dabb5a60c Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Mon, 28 Dec 2020 14:28:00 +0000 Subject: Commit to trigger tests --- .github/scripts/test_p2r.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/test_p2r.sh b/.github/scripts/test_p2r.sh index e7c1139..5236c74 100644 --- a/.github/scripts/test_p2r.sh +++ b/.github/scripts/test_p2r.sh @@ -10,7 +10,7 @@ # that runs Ubuntu Xenial. It will affect the system installed packages. # # Author: G.J.J. van den Burg -# Date: 2020-11-06 +# Date: 2020-12-28 # set -e -u -x -o pipefail -- cgit v1.2.3 From 1b2ddaaf838f66ec210c2ec13faa98dc81f860ae Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Mon, 28 Dec 2020 14:30:02 +0000 Subject: Specify version number --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d69f3eb..549238c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,7 +5,7 @@ on: push jobs: p2r-test: name: Unit tests for paper2remarkable - runs-on: ubuntu-xenial + runs-on: ubuntu-16.04 steps: - name: Install Python 3.6 -- cgit v1.2.3 From d1d3cf01d8f16ddb56e25645ed32a8c0df19e048 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Mon, 28 Dec 2020 14:31:14 +0000 Subject: Make script executable --- .github/scripts/test_p2r.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 .github/scripts/test_p2r.sh diff --git a/.github/scripts/test_p2r.sh b/.github/scripts/test_p2r.sh old mode 100644 new mode 100755 -- cgit v1.2.3 From fe42dd127df06d58d56999da806bcfa2a60290ab Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Mon, 28 Dec 2020 15:20:52 +0000 Subject: Rename test workflow --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 549238c..bf8972e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Test paper2reMarkable +name: build on: push -- cgit v1.2.3 From 7e85723d9cd5f73ad8849017a8b7d629dfd4cc57 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Mon, 28 Dec 2020 15:22:46 +0000 Subject: Update badge in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6ee330d..70efbf2 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 -- cgit v1.2.3