Merge pull request #222 from ifad/chore/update-dependencies #255
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
permissions: | |
contents: read | |
jobs: | |
test: | |
name: Ruby specs | |
runs-on: ubuntu-latest | |
services: | |
redis: | |
image: redis | |
ports: ['6379:6379'] | |
options: --entrypoint redis-server | |
env: | |
TIKA_VERSION: '1.28.5' | |
WKHTMLTOPDF_VERSION: '0.12.3' | |
steps: | |
- name: Install ImageMagick, libmagic-dev, LibreOffice, Tesseract OCR | |
run: | | |
sudo apt-get update | |
sudo apt-get -yq --no-install-suggests --no-install-recommends install imagemagick libmagic-dev libreoffice tesseract-ocr | |
- uses: actions/cache@v3 | |
name: Check Apache Tika | |
id: cache-tika | |
with: | |
path: | | |
~/.local/bin/tika | |
~/.local/bin/tika-app.jar | |
key: ${{ runner.os }}-tika-bin-cache-${{ env.TIKA_VERSION }} | |
- uses: actions/cache@v3 | |
name: Check wkhtmltopdf | |
id: cache-wkhtmltopdf | |
with: | |
path: | | |
~/.local/bin/wkhtmltopdf | |
key: ${{ runner.os }}-wkhtmltopdf-bin-cache-${{ env.WKHTMLTOPDF_VERSION }} | |
- name: Install Tika | |
if: steps.cache-tika.outputs.cache-hit != 'true' | |
run: | | |
mkdir -p ~/.local/bin | |
wget --quiet https://archive.apache.org/dist/tika/${TIKA_VERSION}/tika-app-${TIKA_VERSION}.jar -O ~/.local/bin/tika-app.jar | |
echo $'#!/bin/sh\n\nARGS="$@"\n\n[ $# -eq 0 ] && ARGS="--help"\n\nexec java -jar ~/.local/bin/tika-app.jar $ARGS\n' > ~/.local/bin/tika | |
chmod +x ~/.local/bin/tika | |
- name: Install wkhtmltopdf (with qt) | |
if: steps.cache-wkhtmltopdf.outputs.cache-hit != 'true' | |
run: | | |
mkdir -p ~/.local/bin | |
wget --quiet https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/${WKHTMLTOPDF_VERSION}/wkhtmltox-${WKHTMLTOPDF_VERSION}_linux-generic-amd64.tar.xz -O wkhtmltox.tar.xz | |
tar -xf wkhtmltox.tar.xz | |
mv wkhtmltox/bin/wkhtmltopdf ~/.local/bin/wkhtmltopdf | |
rm -rf wkhtmltox wkhtmltox.tar.xz | |
- name: Show versions of libraries | |
run: | | |
convert --version | |
libreoffice --version | |
tesseract --version | |
tika --version | |
wkhtmltopdf --version | |
- uses: actions/checkout@v3 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '2.6.10' | |
bundler-cache: true | |
- name: Run specs | |
run: bundle exec rake spec |