Skip to content

Commit

Permalink
Merge pull request #14 from withanage/main-github-actions
Browse files Browse the repository at this point in the history
Add github actions support for main
  • Loading branch information
withanage authored Jul 31, 2024
2 parents 601aef5 + a19861c commit 21b3ca1
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 73 deletions.
36 changes: 36 additions & 0 deletions .github/actions/tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

set -e

# Install JRE and Lucene
sudo apt-get install openjdk-11-jre
cd plugins/generic/lucene/lib
wget https://archive.apache.org/dist/lucene/solr/8.1.1/solr-8.1.1.zip
unzip solr-8.1.1.zip
ln -s solr-8.1.1 solr
cd ../../../../
# Ensure we don't get any false positives from the built-in search index by deleting its contents.
#echo "DELETE FROM submission_search_object_keywords; DELETE FROM submission_search_keyword_list; DELETE FROM submission_search_objects;" | ~//datasets/tools/dbclient.sh
if [[ "$TEST" == "mysql" || "$TEST" == "mariadb" ]]; then
sudo mysql -u root -e "use ojs-ci; DELETE FROM submission_search_object_keywords; DELETE FROM submission_search_keyword_list; DELETE FROM submission_search_objects; ";
elif [[ "$TEST" == "psql" ]]; then
psql -d ojs-ci -c "DELETE FROM submission_search_object_keywords;"
psql -d ojs-ci -c "DELETE FROM submission_search_keyword_list;"
psql -d ojs-ci -c "DELETE FROM submission_search_objects;"

fi

#Install plugin version (not included in dataset DB dump). FIXME: Build and install plugin through upload?
php lib/pkp/tools/installPluginVersion.php plugins/generic/lucene/version.xml

# Check Lucene configuration and start server
# (Lucene plugin does not like relative file paths; make absolute in config file)
sed -i -e "s/files_dir = files/files_dir = \/home\/runner\/ojs\/files/" config.inc.php
cd plugins/generic/lucene/embedded/bin
./chkconfig.sh
./start.sh

# Run plugin test set
cd ~/$APPLICATION

npx cypress run --config '{"specPattern":["plugins/generic/lucene/cypress/tests/functional/*.cy.js"]}'
30 changes: 30 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
on: [push]
name: lucene
jobs:
lucene:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- application: ojs
php-version: 8.3
database: mysql
- application: ojs
php-version: 8.2
database: mysql
- application: ojs
php-version: 8.3
database: pgsql
- application: ojs
php-version: 8.2
database: pgsql
name: lucene
steps:
- uses: pkp/pkp-github-actions@v1
with:
node_version: 20
branch: main
repository: pkp
plugin: true
dataset_inject: true
73 changes: 0 additions & 73 deletions .travis.yml

This file was deleted.

0 comments on commit 21b3ca1

Please sign in to comment.