Add ability to configure vips_tmp_directory #225
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: [ '*' ] | |
jobs: | |
ci-rails-app: | |
# Ubuntu 24 has vips 8.15, but Ubuntu 22 only has vips 8.12. | |
# We want at least version 8.15 because >= 8.15 supports the revalidate feature. | |
runs-on: ubuntu-24.04 | |
strategy: | |
matrix: | |
ruby-version: ['3.2.2'] | |
node: ['20'] | |
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 | |
SOFFICE_BINARY_PATH: /usr/bin/libreoffice | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Update apt package index | |
run: sudo apt-get update | |
- name: Install other apt dependencies | |
run: sudo apt-get install -y ffmpeg ghostscript libreoffice | |
- name: Install vips | |
run: sudo apt install -y libvips-tools | |
- name: Check vips version | |
run: vips --version | |
- 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: 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 }} SOFFICE_BINARY_PATH=${{ env.SOFFICE_BINARY_PATH }} | |
- name: Run CI task | |
run: bundle exec rake derivativo:ci |