From 45c86e559bcf39ab04ae802a250b638f48b5c975 Mon Sep 17 00:00:00 2001 From: withanage Date: Mon, 29 Jul 2024 22:15:35 +0200 Subject: [PATCH] Add github actions support for main --- .github/actions/tests.sh | 9 +++++++ .github/workflows/main.yml | 54 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 51 ----------------------------------- 3 files changed, 63 insertions(+), 51 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..2482793 --- /dev/null +++ b/.github/actions/tests.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +npx cypress run --spec "cypress/tests/data/10-Installation.spec.js,cypress/tests/data/20-CreateContext.spec.js" + +npx cypress run --headless --browser chrome --config '{"specPattern":["plugins/generic/customHeader/cypress/tests/functional/*.cy.js"]}' + + diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..3ce0f9a --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,54 @@ +on: [push] +name: customHeader +jobs: + customHeader: + 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 + - application: omp + php-version: 8.3 + database: mysql + - application: omp + php-version: 8.2 + database: mysql + - application: omp + php-version: 8.3 + database: pgsql + - application: omp + php-version: 8.2 + database: pgsql + - application: ops + php-version: 8.3 + database: mysql + - application: ops + php-version: 8.2 + database: mysql + - application: ops + php-version: 8.3 + database: pgsql + - application: ops + php-version: 8.2 + database: pgsql + + name: customHeader + steps: + - uses: xmlFlow/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 2124695..0000000 --- a/.travis.yml +++ /dev/null @@ -1,51 +0,0 @@ -# @file -# .travis.yml - PKP Plugins Integration - -dist: focal -os: linux -language: php - -addons: - chrome: beta - 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 - - APPLICATION=omp BRANCH=main TEST=mysql - - APPLICATION=omp BRANCH=main TEST=pgsql - - APPLICATION=ops BRANCH=main TEST=mysql - - APPLICATION=ops BRANCH=main TEST=pgsql - -install: - - php --version | grep "PHP 8.2" && sudo apt-get install libonig5 - # 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 - # Make sure we're using the current checkout of this repo rather than the built-in OJS/OMP version - - ln -s ${TRAVIS_BUILD_DIR} ~/${APPLICATION}/plugins/generic/customHeader - # Install OJS/OMP & prep data environment -script: - - $(npm bin)/cypress run --spec "cypress/tests/data/10-ApplicationSetup/10-Installation.cy.js,cypress/tests/data/10-ApplicationSetup/20-CreateContext.cy.js" - - $(npm bin)/cypress run --config '{"specPattern":["plugins/generic/customHeader/cypress/tests/functional/*.cy.js"]}' -after_failure: - - cat error.log - - sudo apt-get install sharutils - - tar cz cypress/screenshots | uuencode /dev/stdout