From b8469733690aa7dd05f13171bcd994ee20062a42 Mon Sep 17 00:00:00 2001 From: withanage Date: Wed, 31 Jul 2024 21:32:17 +0200 Subject: [PATCH] Add github actions support for main --- .github/actions/tests.sh | 7 ++++++ .github/workflows/main.yml | 31 +++++++++++++++++++++++ .travis.yml | 50 -------------------------------------- 3 files changed, 38 insertions(+), 50 deletions(-) create mode 100755 .github/actions/tests.sh create mode 100644 .github/workflows/main.yml delete mode 100644 .travis.yml diff --git a/.github/actions/tests.sh b/.github/actions/tests.sh new file mode 100755 index 0000000..93c8aaa --- /dev/null +++ b/.github/actions/tests.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -e + +npx cypress run --headless --browser chrome --config '{"specPattern":["plugins/generic/pluginTemplate/cypress/tests/functional/*.cy.js"]}' + + diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..68e4e5c --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,31 @@ +on: [push] +name: pluginTemplate +jobs: + pluginTemplate: + 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: pluginTemplate + steps: + - uses: pkp/pkp-github-actions@v1 + with: + node_version: 20 + branch: main + repository: pkp + plugin: true + diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 166c4bd..0000000 --- a/.travis.yml +++ /dev/null @@ -1,50 +0,0 @@ -dist: bionic -os: linux -language: php - -addons: - postgresql: "9.5" - apt: - update: true - packages: - - libvulkan1 - - libu2f-udev - -sudo: required - -php: - - 8.1.0 - - 8.2.0 -env: - - APPLICATION=ojs BRANCH=main TEST=mysql - - APPLICATION=ojs BRANCH=main TEST=pgsql - -install: - # Prepare OJS/OMP environment - - git clone -b ${BRANCH} https://github.com/pkp/${APPLICATION} ~/${APPLICATION} - - cd ~/${APPLICATION} - - git submodule update --init --recursive - - source lib/pkp/tools/travis/prepare-tests.sh - - lib/pkp/tools/travis/prepare-webserver.sh - # Build/install dependencies - - lib/pkp/tools/travis/install-composer-dependencies.sh - - npm i g -npm && npm install && npm run build - # Install this plugin's source - - cp -r ${TRAVIS_BUILD_DIR} ~/${APPLICATION}/plugins/generic/pluginTemplate - -script: - # Install data set - - git clone https://github.com/pkp/datasets - - cp datasets/${APPLICATION}/${BRANCH}/${TEST}/config.inc.php . - - cp -rf datasets/${APPLICATION}/${BRANCH}/${TEST}/public/* public/ - - cp -rf datasets/${APPLICATION}/${BRANCH}/${TEST}/files/* files/ - - cat datasets/${APPLICATION}/${BRANCH}/${TEST}/database.sql | ./datasets/tools/dbclient.sh - - php lib/pkp/tools/installPluginVersion.php plugins/generic/pluginTemplate/version.xml - - # Run Cypress tests - - $(npm bin)/cypress run --config '{"specPattern":["plugins/generic/pluginTemplate/cypress/tests/functional/*.cy.js"]}' - -after_failure: - - cat error.log - - sudo apt-get install sharutils - - tar cz cypress/screenshots | uuencode /dev/stdout