You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
117 lines
3.7 KiB
117 lines
3.7 KiB
4 years ago
|
# This is a basic workflow to help you get started with Actions
|
||
|
|
||
|
name: CI
|
||
|
|
||
|
# Controls when the action will run.
|
||
|
on:
|
||
3 years ago
|
# Triggers the workflow on push or pull request events but only for the 2.x branch
|
||
4 years ago
|
push:
|
||
3 years ago
|
branches: [ 2.x ]
|
||
4 years ago
|
pull_request:
|
||
3 years ago
|
branches: [ 2.x ]
|
||
4 years ago
|
|
||
|
# Allows you to run this workflow manually from the Actions tab
|
||
|
workflow_dispatch:
|
||
|
|
||
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||
|
jobs:
|
||
|
# This workflow contains a single job called "build"
|
||
|
build:
|
||
|
# The type of runner that the job will run on
|
||
|
runs-on: ubuntu-latest
|
||
|
strategy:
|
||
|
matrix:
|
||
|
php-versions: ["7.3", "7.4"]
|
||
|
test-suite: ["kernel", "functional", "functional-javascript"]
|
||
4 years ago
|
drupal-version: ["8.9.11", "9.1.5"]
|
||
4 years ago
|
|
||
|
name: PHP ${{ matrix.php-versions }} drupal ${{ matrix.drupal-version }} test-suite ${{ matrix.test-suite }}
|
||
|
|
||
|
services:
|
||
|
mysql:
|
||
|
image: mysql:5.7
|
||
|
env:
|
||
|
MYSQL_ALLOW_EMPTY_PASSWORD: yes
|
||
|
MYSQL_DATABASE: drupal
|
||
|
ports:
|
||
|
- 3306:3306
|
||
|
activemq:
|
||
|
image: webcenter/activemq:5.14.3
|
||
|
ports:
|
||
|
- 8161:8161
|
||
|
- 61616:61616
|
||
|
- 61613:61613
|
||
|
|
||
|
# Steps represent a sequence of tasks that will be executed as part of the job
|
||
|
steps:
|
||
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||
|
- name: Checkout code
|
||
|
uses: actions/checkout@v2
|
||
|
with:
|
||
|
path: build_dir
|
||
|
|
||
|
- name: Checkout islandora_ci
|
||
|
uses: actions/checkout@v2
|
||
|
with:
|
||
|
repository: islandora/islandora_ci
|
||
|
ref: github-actions
|
||
|
path: islandora_ci
|
||
|
|
||
|
- name: Setup PHP
|
||
|
uses: shivammathur/setup-php@v2
|
||
|
with:
|
||
|
php-version: ${{ matrix.php-versions }}
|
||
|
tools: composer:v2
|
||
|
|
||
|
- name: Setup Mysql client
|
||
|
run: |
|
||
|
sudo apt-get update
|
||
|
sudo apt-get install -y mysql-client
|
||
|
|
||
|
- name: Set environment variables
|
||
|
run: |
|
||
|
echo "DRUPAL_VERSION=${{ matrix.drupal-version }}" >> $GITHUB_ENV
|
||
|
echo "SCRIPT_DIR=$GITHUB_WORKSPACE/islandora_ci" >> $GITHUB_ENV
|
||
|
echo "DRUPAL_DIR=/opt/drupal" >> $GITHUB_ENV
|
||
|
echo "PHPUNIT_FILE=$GITHUB_WORKSPACE/build_dir/phpunit.xml" >> $GITHUB_ENV
|
||
|
|
||
|
- name: Cache Composer dependencies
|
||
|
uses: actions/cache@v2
|
||
|
with:
|
||
|
path: /tmp/composer-cache
|
||
|
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
|
||
|
|
||
|
- name: Setup Drupal
|
||
|
run: |
|
||
|
mkdir $DRUPAL_DIR
|
||
|
$SCRIPT_DIR/travis_setup_drupal.sh
|
||
|
cd $DRUPAL_DIR
|
||
|
chmod -R u+w web/sites/default
|
||
|
mkdir -p web/sites/simpletest/browser_output
|
||
|
|
||
|
- name: Setup composer paths
|
||
|
run: |
|
||
3 years ago
|
git -C "$GITHUB_WORKSPACE/build_dir" checkout -b github-testing
|
||
4 years ago
|
cd $DRUPAL_DIR
|
||
|
composer config repositories.local path "$GITHUB_WORKSPACE/build_dir"
|
||
4 years ago
|
composer config minimum-stability dev
|
||
3 years ago
|
composer require "islandora/islandora:dev-github-testing as dev-2.x"
|
||
4 years ago
|
|
||
|
- name: Install modules
|
||
|
run: |
|
||
|
cd $DRUPAL_DIR/web
|
||
|
drush --uri=127.0.0.1:8282 en -y islandora_audio islandora_breadcrumbs islandora_iiif islandora_image islandora_video islandora_text_extraction_defaults
|
||
|
drush --uri=127.0.0.1:8282 fim -y islandora_core_feature,islandora_text_extraction_defaults
|
||
|
|
||
|
- name: Copy PHPunit file
|
||
|
run: cp $PHPUNIT_FILE $DRUPAL_DIR/web/core/phpunit.xml
|
||
|
|
||
|
- name: Test scripts
|
||
|
run: $SCRIPT_DIR/travis_scripts.sh
|
||
|
|
||
|
- name: PHPUNIT tests
|
||
|
run: |
|
||
|
cd $DRUPAL_DIR/web/core
|
||
|
$DRUPAL_DIR/vendor/bin/phpunit --verbose --testsuite "${{ matrix.test-suite }}"
|
||
|
|