Skip to content

Added gha with automated tests #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Push tests
# run-name: ${{ github.actor }} push tests

on:
push:
pull_request:

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- python: 2.7.18
plone: 4.3
services:
libreoffice:
image: harbor.imio.be/library/libreoffice:7.3
ports:
- 2002:2002
volumes:
- /tmp:/tmp
- /var/tmp:/var/tmp
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Env
run: |
# Install libreoffice and other dependencies
mkdir -p -m 777 /tmp/appy/
sudo add-apt-repository ppa:libreoffice/ppa -y
sudo apt update -qq -y
sudo apt-get install -qq -y libreoffice libreoffice-script-provider-python g++ gcc make cmake build-essential libreadline6-dev zlib1g-dev libbz2-dev libjpeg62-dev subversion git libpq-dev libxml2-dev libxslt1-dev libssl-dev pkg-config graphviz graphviz-dev odt2txt

# Set up buildout cache directories
mkdir -p -m 777 /home/runner/.buildout
touch /home/runner/.buildout/default.cfg
echo "[buildout]" > /home/runner/.buildout/default.cfg
echo "eggs-directory = /home/runner/buildout-cache/eggs" >> /home/runner/.buildout/default.cfg
echo "download-cache = /home/runner/buildout-cache/downloads" >> /home/runner/.buildout/default.cfg
echo "extends-cache = /home/runner/buildout-cache/extends" >> /home/runner/.buildout/default.cfg
mkdir -p /home/runner/buildout-cache/{eggs,downloads,extends}
- name: Set up pyenv and Python
uses: "gabrielfalcao/pyenv-action@v18"
with:
default: "${{ matrix.python }}"
- name: Setup Python env
run: |
pip install --upgrade pip
pip install --upgrade virtualenv
virtualenv .
bin/pip install --upgrade pip
bin/pip install -r requirements.txt
- name: Setup Zint
run: |
sudo apt install -qq -y libpng-dev
wget https://sourceforge.net/projects/zint/files/zint/2.9.1/zint-2.9.1-src.tar.gz
tar -xvf zint-2.9.1-src.tar.gz
cd zint-2.9.1-src
mkdir build
cd build
sudo cmake ..
sudo make install
- name: Setup Docsplit
run: |
sudo apt install -qq -y gnupg2
gpg2 --keyserver hkp://keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
curl -sSL https://get.rvm.io | bash -s stable
source $HOME/.rvm/scripts/rvm

# Puis Ruby 2.7.6 :
rvm pkg install openssl
rvm install ruby-2.7.6 --with-openssl-dir=$HOME/.rvm/usr

# Pour voir la version de ruby installée :
which ruby

# Création d'un lien symbolique pour que docsplit puisse utiliser ruby (si pas de ruby système) :
sudo ln -s $HOME/.rvm/rubies/ruby-2.7.6/bin/ruby /usr/bin/ruby2.7
sudo rm /usr/bin/ruby
sudo ln -s ruby2.7 /usr/bin/ruby

# Enfin, on peut installer les autres dépendances de documentviewer :
gem install docsplit
echo "$HOME/.rvm/gems/ruby-2.7.6/gems/docsplit-0.7.6/bin" >> $GITHUB_PATH
sudo apt install -qq -y graphicsmagick wv poppler-utils
- name: Cache eggs
uses: actions/cache@v4
env:
cache-name: cache-eggs
with:
path: /home/runner/buildout-cache/eggs
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ matrix.python }}-${{ matrix.plone }}
- name: buildout
run: |
bin/buildout annotate
bin/buildout
- name: test
run: |
bin/testme