Skip to content

Commit b9c7ebb

Browse files
committed
Added gha with automated tests
1 parent b1870ff commit b9c7ebb

File tree

1 file changed

+106
-0
lines changed

1 file changed

+106
-0
lines changed

.github/workflows/main.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Push tests
5+
# run-name: ${{ github.actor }} push tests
6+
7+
on:
8+
push:
9+
pull_request:
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
include:
18+
- python: 2.7.18
19+
plone: 4.3
20+
services:
21+
libreoffice:
22+
image: harbor.imio.be/library/libreoffice:7.3
23+
ports:
24+
- 2002:2002
25+
volumes:
26+
- /tmp:/tmp
27+
- /var/tmp:/var/tmp
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
- name: Setup Env
32+
run: |
33+
# Install libreoffice and other dependencies
34+
mkdir -p -m 777 /tmp/appy/
35+
sudo add-apt-repository ppa:libreoffice/ppa -y
36+
sudo apt update -qq -y
37+
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
38+
39+
# Set up buildout cache directories
40+
mkdir -p -m 777 /home/runner/.buildout
41+
touch /home/runner/.buildout/default.cfg
42+
echo "[buildout]" > /home/runner/.buildout/default.cfg
43+
echo "eggs-directory = /home/runner/buildout-cache/eggs" >> /home/runner/.buildout/default.cfg
44+
echo "download-cache = /home/runner/buildout-cache/downloads" >> /home/runner/.buildout/default.cfg
45+
echo "extends-cache = /home/runner/buildout-cache/extends" >> /home/runner/.buildout/default.cfg
46+
mkdir -p /home/runner/buildout-cache/{eggs,downloads,extends}
47+
- name: Set up pyenv and Python
48+
uses: "gabrielfalcao/pyenv-action@v18"
49+
with:
50+
default: "${{ matrix.python }}"
51+
- name: Setup Python env
52+
run: |
53+
pip install --upgrade pip
54+
pip install --upgrade virtualenv
55+
virtualenv .
56+
bin/pip install --upgrade pip
57+
bin/pip install -r requirements.txt
58+
- name: Setup Zint
59+
run: |
60+
sudo apt install -qq -y libpng-dev
61+
wget https://sourceforge.net/projects/zint/files/zint/2.9.1/zint-2.9.1-src.tar.gz
62+
tar -xvf zint-2.9.1-src.tar.gz
63+
cd zint-2.9.1-src
64+
mkdir build
65+
cd build
66+
sudo cmake ..
67+
sudo make install
68+
- name: Setup Docsplit
69+
run: |
70+
sudo apt install -qq -y gnupg2
71+
gpg2 --keyserver hkp://keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
72+
curl -sSL https://get.rvm.io | bash -s stable
73+
source $HOME/.rvm/scripts/rvm
74+
75+
# Puis Ruby 2.7.6 :
76+
rvm pkg install openssl
77+
rvm install ruby-2.7.6 --with-openssl-dir=$HOME/.rvm/usr
78+
79+
# Pour voir la version de ruby installée :
80+
which ruby
81+
82+
# Création d'un lien symbolique pour que docsplit puisse utiliser ruby (si pas de ruby système) :
83+
sudo ln -s $HOME/.rvm/rubies/ruby-2.7.6/bin/ruby /usr/bin/ruby2.7
84+
85+
# Enfin, on peut installer les autres dépendances de documentviewer :
86+
gem install docsplit
87+
ls -l $HOME/.rvm/gems/ruby-2.7.6
88+
ls -l $HOME/.rvm/gems/ruby-2.7.6/gems
89+
ls -l $HOME/.rvm/gems/ruby-2.7.6/gems/docsplit-0.7.6
90+
ls -l $HOME/.rvm/gems/ruby-2.7.6/gems/docsplit-0.7.6/bin
91+
echo "$HOME/.rvm/gems/ruby-2.7.6/gems/docsplit-0.7.6/bin" >> $GITHUB_PATH
92+
sudo apt install -qq -y graphicsmagick wv
93+
- name: Cache eggs
94+
uses: actions/cache@v4
95+
env:
96+
cache-name: cache-eggs
97+
with:
98+
path: /home/runner/buildout-cache/eggs
99+
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ matrix.python }}-${{ matrix.plone }}
100+
- name: buildout
101+
run: |
102+
bin/buildout annotate
103+
bin/buildout
104+
- name: test
105+
run: |
106+
bin/testme

0 commit comments

Comments
 (0)