Skip to content

#114 Cache Solr downloads when running GitHub workflows #1020

#114 Cache Solr downloads when running GitHub workflows

#114 Cache Solr downloads when running GitHub workflows #1020

Workflow file for this run

name: PHP Composer
on:
push:
pull_request:
types: [assigned, opened, synchronize, reopened]
schedule:
- cron: '30 1 * * *'
jobs:
build:
runs-on: ubuntu-22.04
strategy:
matrix:
versions: [{php: '8.1', solr: '9.4.0'}]
name: PHP ${{ matrix.versions.php }} Test
steps:
- uses: actions/checkout@v3
- name: Setup PHP ${{ matrix.versions.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.versions.php }}
- name: Check PHP Version
run: php -v
- name: Install Composer and Dependencies
run: sudo apt-get update && curl -s http://getcomposer.org/installer | php && php composer.phar self-update && php composer.phar install
- name: Get Solr ${{ matrix.versions.solr }} from cache
id: cache-solr
uses: actions/cache@v3
with:
path: solr-${{ matrix.versions.solr }}.tgz
key: solr-${{ matrix.versions.solr }}.tgz
- name: Download Solr ${{ matrix.versions.solr }}
if: steps.cache-solr.outputs.cache-hit != 'true'
run: sudo bash bin/download_solr_docker.sh --version ${{ matrix.versions.solr }}
- name: Install Solr ${{ matrix.versions.solr }}
run: sudo bash bin/install_solr_docker.sh --version ${{ matrix.versions.solr }}
- name: Start MySQL
run: sudo systemctl start mysql.service
- name: Prepare workspace
run: ant prepare-workspace
- name: Prepare search config
run: ant prepare-config
- name: Prepare database
run: bash vendor/bin/opus4db --adminpwd root --userpwd root --sqlpwd root
- name: Basic PHP file check
run: ant lint
- name: Tests
run: php composer.phar test
- name: Coding Style
run: php composer.phar cs-check