Skip to content

Rubocop fixes

Rubocop fixes #93

Workflow file for this run

name: CI
on:
push:
branches: [ '*' ]
jobs:
ci-rails-app:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['3.1.3']
node: ['16']
env:
RAILS_ENV: test
NOKOGIRI_USE_SYSTEM_LIBRARIES: true
TIKA_VERSION: 2.9.0
TIKA_DOWNLOAD_DIR: /tmp/downloads/tika
TIKA_JAR_PATH: /tmp/downloads/tika/tika-app.jar
steps:
- uses: actions/checkout@v3
- name: Cache action for Apache Tika download
id: cache-tika-download
uses: actions/cache@v3
with:
path: ${{ env.TIKA_DOWNLOAD_DIR }}
key: ${{ runner.os }}-tika-${{ env.TIKA_VERSION }}-download
- name: Update apt package index
run: sudo apt-get update
- name: Install other apt dependencies
run: sudo apt-get install -y libvips42 ffmpeg ghostscript libreoffice
- name: Download Tika
run: |
# Early exit from this run script if TIKA_DOWNLOAD_DIR already exists
if [ -d "$TIKA_DOWNLOAD_DIR" ]; then echo 'Found cached Tika download' && exit; fi
echo "Downloading Tika because no cached directory was found at: $TIKA_DOWNLOAD_DIR"
mkdir -p $TIKA_DOWNLOAD_DIR
cd $TIKA_DOWNLOAD_DIR
wget "https://archive.apache.org/dist/tika/${TIKA_VERSION}/tika-app-${TIKA_VERSION}.jar"
mv tika-app-${TIKA_VERSION}.jar tika-app.jar
- name: Add --no-document option to .gemrc file to speed up bundle install
run: "echo 'gem: --no-document' > ~/.gemrc"
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- run: npm install -g yarn
- run: yarn install --frozen-lockfile
- name: Set up config files (with custom TIKA_JAR_PATH)
run: bundle exec rake derivativo:setup:config_files TIKA_JAR_PATH=${{ env.TIKA_JAR_PATH }}
- name: Run CI task
run: bundle exec rake derivativo:ci